From 7049632d8a6ff3fe6e75c2fd15cd45b31f0d3ca7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:27:26 +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: eyJwIjoiZ29vZ2xlLWNsb3VkLXBvbGljeV90cm91Ymxlc2hvb3Rlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXBvbGljeV90cm91Ymxlc2hvb3Rlci8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByaXZhdGVfY2F0YWxvZy12MWJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByaXZhdGVfY2F0YWxvZy8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByaXZpbGVnZWRfYWNjZXNzX21hbmFnZXItdjEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByaXZpbGVnZWRfYWNjZXNzX21hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByb2ZpbGVyLXYyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXByb2ZpbGVyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJhcGlkX21pZ3JhdGlvbl9hc3Nlc3NtZW50LXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJhcGlkX21pZ3JhdGlvbl9hc3Nlc3NtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYV9lbnRlcnByaXNlLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYV9lbnRlcnByaXNlLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY2FwdGNoYV9lbnRlcnByaXNlLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY29tbWVuZGF0aW9uX2VuZ2luZS12MWJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY29tbWVuZGF0aW9uX2VuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY29tbWVuZGVyLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlY29tbWVuZGVyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXItdjEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXItdjFiZXRhMS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXIvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== --- .../.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 | 23 + ...gle-cloud-policy_troubleshooter-v1.gemspec | 29 + .../google-cloud-policy_troubleshooter-v1.rb | 21 + .../google/cloud/policy_troubleshooter/v1.rb | 45 + .../policy_troubleshooter/v1/iam_checker.rb | 56 + .../v1/iam_checker/client.rb | 476 +++ .../v1/iam_checker/credentials.rb | 51 + .../v1/iam_checker/rest.rb | 53 + .../v1/iam_checker/rest/client.rb | 434 +++ .../v1/iam_checker/rest/service_stub.rb | 141 + .../cloud/policy_troubleshooter/v1/rest.rb | 37 + .../cloud/policy_troubleshooter/v1/version.rb | 28 + .../policytroubleshooter/v1/checker_pb.rb | 50 + .../v1/checker_services_pb.rb | 49 + .../v1/explanations_pb.rb | 55 + .../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/policytroubleshooter/v1/checker.rb | 63 + .../policytroubleshooter/v1/explanations.rb | 268 ++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../iam_checker/troubleshoot_iam_policy.rb | 47 + ..._google.cloud.policytroubleshooter.v1.json | 55 + .../v1/iam_checker_rest_test.rb | 153 + .../v1/iam_checker_test.rb | 162 + .../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 ++ ...le-cloud-policy_troubleshooter-iam.gemspec | 27 + .../google-cloud-policy_troubleshooter-iam.rb | 19 + .../google/cloud/policy_troubleshooter/iam.rb | 160 + .../policy_troubleshooter/iam/version.rb | 28 + .../policy_troubleshooter/iam/client_test.rb | 64 + .../policy_troubleshooter/iam/version_test.rb | 26 + .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.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-policy_troubleshooter.gemspec | 27 + .../lib/google-cloud-policy_troubleshooter.rb | 19 + .../lib/google/cloud/policy_troubleshooter.rb | 158 + .../cloud/policy_troubleshooter/version.rb | 26 + .../policy_troubleshooter/client_test.rb | 64 + .../policy_troubleshooter/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 | 168 ++ .../gapic_metadata.json | 33 + ...ogle-cloud-private_catalog-v1beta1.gemspec | 28 + .../google-cloud-private_catalog-v1beta1.rb | 21 + .../google/cloud/private_catalog/v1beta1.rb | 45 + .../v1beta1/private_catalog.rb | 74 + .../v1beta1/private_catalog/client.rb | 738 +++++ .../v1beta1/private_catalog/credentials.rb | 51 + .../v1beta1/private_catalog/rest.rb | 71 + .../v1beta1/private_catalog/rest/client.rb | 674 +++++ .../private_catalog/rest/service_stub.rb | 306 ++ .../cloud/private_catalog/v1beta1/rest.rb | 37 + .../cloud/private_catalog/v1beta1/version.rb | 28 + .../v1beta1/private_catalog_pb.rb | 66 + .../v1beta1/private_catalog_services_pb.rb | 72 + .../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 ++ .../privatecatalog/v1beta1/private_catalog.rb | 506 ++++ .../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/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../private_catalog/search_catalogs.rb | 51 + .../private_catalog/search_products.rb | 51 + .../private_catalog/search_versions.rb | 51 + ...a_google.cloud.privatecatalog.v1beta1.json | 135 + .../v1beta1/private_catalog_rest_test.rb | 270 ++ .../v1beta1/private_catalog_test.rb | 311 ++ .../test/helper.rb | 25 + .../google-cloud-private_catalog/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-private_catalog/.rubocop.yml | 39 + .../google-cloud-private_catalog/.toys.rb | 28 + .../google-cloud-private_catalog/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-private_catalog/CHANGELOG.md | 2 + .../google-cloud-private_catalog/Gemfile | 28 + .../google-cloud-private_catalog/LICENSE.md | 201 ++ .../google-cloud-private_catalog/README.md | 142 + .../google-cloud-private_catalog/Rakefile | 169 ++ .../google-cloud-private_catalog.gemspec | 27 + .../lib/google-cloud-private_catalog.rb | 19 + .../lib/google/cloud/private_catalog.rb | 176 ++ .../google/cloud/private_catalog/version.rb | 26 + .../cloud/private_catalog/client_test.rb | 64 + .../cloud/private_catalog/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 | 201 ++ .../Rakefile | 169 ++ .../gapic_metadata.json | 88 + ...cloud-privileged_access_manager-v1.gemspec | 29 + ...ogle-cloud-privileged_access_manager-v1.rb | 21 + .../cloud/privileged_access_manager/v1.rb | 45 + .../v1/bindings_override.rb | 107 + .../v1/privileged_access_manager.rb | 75 + .../v1/privileged_access_manager/client.rb | 1940 ++++++++++++ .../privileged_access_manager/credentials.rb | 47 + .../privileged_access_manager/operations.rb | 841 ++++++ .../v1/privileged_access_manager/paths.rb | 206 ++ .../v1/privileged_access_manager/rest.rb | 73 + .../privileged_access_manager/rest/client.rb | 1807 ++++++++++++ .../rest/operations.rb | 967 ++++++ .../rest/service_stub.rb | 1149 ++++++++ .../privileged_access_manager/v1/rest.rb | 38 + .../privileged_access_manager/v1/version.rb | 28 + .../v1/privilegedaccessmanager_pb.rb | 109 + .../v1/privilegedaccessmanager_services_pb.rb | 122 + .../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/privilegedaccessmanager.rb | 1004 +++++++ .../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 + .../snippets/Gemfile | 32 + .../approve_grant.rb | 47 + .../check_onboarding_status.rb | 47 + .../create_entitlement.rb | 54 + .../privileged_access_manager/create_grant.rb | 47 + .../delete_entitlement.rb | 54 + .../privileged_access_manager/deny_grant.rb | 47 + .../get_entitlement.rb | 47 + .../privileged_access_manager/get_grant.rb | 47 + .../list_entitlements.rb | 51 + .../privileged_access_manager/list_grants.rb | 51 + .../privileged_access_manager/revoke_grant.rb | 54 + .../search_entitlements.rb | 51 + .../search_grants.rb | 51 + .../update_entitlement.rb | 54 + ...ogle.cloud.privilegedaccessmanager.v1.json | 575 ++++ ...ivileged_access_manager_operations_test.rb | 400 +++ .../privileged_access_manager_paths_test.rb | 115 + .../v1/privileged_access_manager_rest_test.rb | 882 ++++++ .../v1/privileged_access_manager_test.rb | 1024 +++++++ .../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 | 189 ++ .../Rakefile | 169 ++ ...le-cloud-privileged_access_manager.gemspec | 27 + .../google-cloud-privileged_access_manager.rb | 19 + .../google/cloud/privileged_access_manager.rb | 175 ++ .../privileged_access_manager/version.rb | 26 + .../privileged_access_manager/client_test.rb | 64 + .../privileged_access_manager/version_test.rb | 26 + .../test/helper.rb | 25 + .../google-cloud-profiler-v2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-profiler-v2/.rubocop.yml | 33 + .../google-cloud-profiler-v2/.toys.rb | 28 + .../google-cloud-profiler-v2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-profiler-v2/CHANGELOG.md | 2 + .../google-cloud-profiler-v2/Gemfile | 11 + .../google-cloud-profiler-v2/LICENSE.md | 201 ++ .../google-cloud-profiler-v2/README.md | 154 + .../google-cloud-profiler-v2/Rakefile | 169 ++ .../gapic_metadata.json | 47 + .../google-cloud-profiler-v2.gemspec | 28 + .../lib/google-cloud-profiler-v2.rb | 21 + .../lib/google/cloud/profiler/v2.rb | 46 + .../cloud/profiler/v2/export_service.rb | 56 + .../profiler/v2/export_service/client.rb | 496 ++++ .../profiler/v2/export_service/credentials.rb | 53 + .../cloud/profiler/v2/export_service/paths.rb | 47 + .../cloud/profiler/v2/export_service/rest.rb | 53 + .../profiler/v2/export_service/rest/client.rb | 446 +++ .../v2/export_service/rest/service_stub.rb | 142 + .../cloud/profiler/v2/profiler_service.rb | 59 + .../profiler/v2/profiler_service/client.rb | 716 +++++ .../v2/profiler_service/credentials.rb | 53 + .../profiler/v2/profiler_service/paths.rb | 64 + .../profiler/v2/profiler_service/rest.rb | 56 + .../v2/profiler_service/rest/client.rb | 652 ++++ .../v2/profiler_service/rest/service_stub.rb | 267 ++ .../lib/google/cloud/profiler/v2/rest.rb | 38 + .../lib/google/cloud/profiler/v2/version.rb | 28 + .../devtools/cloudprofiler/v2/profiler_pb.rb | 60 + .../cloudprofiler/v2/profiler_services_pb.rb | 104 + .../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 ++ .../devtools/cloudprofiler/v2/profiler.rb | 237 ++ .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../google-cloud-profiler-v2/snippets/Gemfile | 32 + .../snippets/export_service/list_profiles.rb | 51 + .../create_offline_profile.rb | 47 + .../profiler_service/create_profile.rb | 47 + .../profiler_service/update_profile.rb | 47 + ...data_google.devtools.cloudprofiler.v2.json | 175 ++ .../profiler/v2/export_service_paths_test.rb | 55 + .../profiler/v2/export_service_rest_test.rb | 155 + .../cloud/profiler/v2/export_service_test.rb | 171 ++ .../v2/profiler_service_paths_test.rb | 67 + .../profiler/v2/profiler_service_rest_test.rb | 265 ++ .../profiler/v2/profiler_service_test.rb | 286 ++ .../google-cloud-profiler-v2/test/helper.rb | 25 + .../google-cloud-profiler/.gitignore | 22 + .../google-cloud-profiler/.repo-metadata.json | 18 + .../google-cloud-profiler/.rubocop.yml | 39 + .../google-cloud-profiler/.toys.rb | 28 + .../google-cloud-profiler/.yardopts | 11 + .../google-cloud-profiler/AUTHENTICATION.md | 122 + .../google-cloud-profiler/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-profiler/Gemfile | 28 + .../google-cloud-profiler/LICENSE.md | 201 ++ .../google-cloud-profiler/README.md | 142 + .../google-cloud-profiler/Rakefile | 169 ++ .../google-cloud-profiler.gemspec | 27 + .../lib/google-cloud-profiler.rb | 19 + .../lib/google/cloud/profiler.rb | 231 ++ .../lib/google/cloud/profiler/version.rb | 26 + .../test/google/cloud/profiler/client_test.rb | 85 + .../google/cloud/profiler/version_test.rb | 26 + .../google-cloud-profiler/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 | 68 + ...loud-rapid_migration_assessment-v1.gemspec | 29 + ...gle-cloud-rapid_migration_assessment-v1.rb | 21 + .../cloud/rapid_migration_assessment/v1.rb | 45 + .../v1/bindings_override.rb | 75 + .../v1/rapid_migration_assessment.rb | 56 + .../v1/rapid_migration_assessment/client.rb | 1527 ++++++++++ .../rapid_migration_assessment/credentials.rb | 47 + .../rapid_migration_assessment/operations.rb | 841 ++++++ .../v1/rapid_migration_assessment/paths.rb | 88 + .../v1/rapid_migration_assessment/rest.rb | 54 + .../rapid_migration_assessment/rest/client.rb | 1422 +++++++++ .../rest/operations.rb | 925 ++++++ .../rest/service_stub.rb | 697 +++++ .../rapid_migration_assessment/v1/rest.rb | 38 + .../rapid_migration_assessment/v1/version.rb | 28 + .../v1/api_entities_pb.rb | 52 + .../v1/rapidmigrationassessment_pb.rb | 65 + .../rapidmigrationassessment_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/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../v1/api_entities.rb | 184 ++ .../v1/rapidmigrationassessment.rb | 272 ++ .../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 + .../snippets/Gemfile | 32 + .../create_annotation.rb | 54 + .../create_collector.rb | 54 + .../delete_collector.rb | 54 + .../get_annotation.rb | 47 + .../get_collector.rb | 47 + .../list_collectors.rb | 51 + .../pause_collector.rb | 54 + .../register_collector.rb | 54 + .../resume_collector.rb | 54 + .../update_collector.rb | 54 + ...gle.cloud.rapidmigrationassessment.v1.json | 415 +++ ...id_migration_assessment_operations_test.rb | 400 +++ .../rapid_migration_assessment_paths_test.rb | 79 + .../rapid_migration_assessment_rest_test.rb | 654 +++++ .../v1/rapid_migration_assessment_test.rb | 768 +++++ .../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 ++ ...e-cloud-rapid_migration_assessment.gemspec | 27 + ...google-cloud-rapid_migration_assessment.rb | 19 + .../cloud/rapid_migration_assessment.rb | 156 + .../rapid_migration_assessment/version.rb | 26 + .../rapid_migration_assessment/client_test.rb | 64 + .../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 | 128 + ...ogle-cloud-recaptcha_enterprise-v1.gemspec | 28 + .../google-cloud-recaptcha_enterprise-v1.rb | 21 + .../google/cloud/recaptcha_enterprise/v1.rb | 40 + .../v1/recaptcha_enterprise_service.rb | 49 + .../v1/recaptcha_enterprise_service/client.rb | 2609 +++++++++++++++++ .../credentials.rb | 51 + .../v1/recaptcha_enterprise_service/paths.rb | 132 + .../cloud/recaptcha_enterprise/v1/version.rb | 28 + .../v1/recaptchaenterprise_pb.rb | 161 + .../v1/recaptchaenterprise_services_pb.rb | 105 + .../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 ++ .../v1/recaptchaenterprise.rb | 2230 ++++++++++++++ .../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 + .../add_ip_override.rb | 47 + .../annotate_assessment.rb | 47 + .../create_assessment.rb | 47 + .../create_firewall_policy.rb | 47 + .../create_key.rb | 47 + .../delete_firewall_policy.rb | 47 + .../delete_key.rb | 47 + .../get_firewall_policy.rb | 47 + .../recaptcha_enterprise_service/get_key.rb | 47 + .../get_metrics.rb | 47 + .../list_firewall_policies.rb | 51 + .../list_ip_overrides.rb | 51 + .../recaptcha_enterprise_service/list_keys.rb | 51 + .../list_related_account_group_memberships.rb | 51 + .../list_related_account_groups.rb | 51 + .../migrate_key.rb | 47 + .../remove_ip_override.rb | 47 + .../reorder_firewall_policies.rb | 47 + .../retrieve_legacy_secret_key.rb | 47 + ...earch_related_account_group_memberships.rb | 51 + .../update_firewall_policy.rb | 47 + .../update_key.rb | 47 + ...a_google.cloud.recaptchaenterprise.v1.json | 895 ++++++ ...recaptcha_enterprise_service_paths_test.rb | 115 + .../v1/recaptcha_enterprise_service_test.rb | 1468 ++++++++++ .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 19 + .../.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 | 28 + ...cloud-recaptcha_enterprise-v1beta1.gemspec | 28 + ...ogle-cloud-recaptcha_enterprise-v1beta1.rb | 21 + .../cloud/recaptcha_enterprise/v1beta1.rb | 45 + .../v1beta1/recaptcha_enterprise_service.rb | 55 + .../recaptcha_enterprise_service/client.rb | 590 ++++ .../credentials.rb | 51 + .../recaptcha_enterprise_service/paths.rb | 64 + .../recaptcha_enterprise_service/rest.rb | 52 + .../rest/client.rb | 533 ++++ .../rest/service_stub.rb | 205 ++ .../recaptcha_enterprise/v1beta1/rest.rb | 37 + .../recaptcha_enterprise/v1beta1/version.rb | 28 + .../v1beta1/recaptchaenterprise_pb.rb | 73 + .../recaptchaenterprise_services_pb.rb | 48 + .../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 ++ .../v1beta1/recaptchaenterprise.rb | 711 +++++ .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../annotate_assessment.rb | 47 + .../create_assessment.rb | 47 + ...gle.cloud.recaptchaenterprise.v1beta1.json | 95 + ...recaptcha_enterprise_service_paths_test.rb | 67 + .../recaptcha_enterprise_service_rest_test.rb | 212 ++ .../recaptcha_enterprise_service_test.rb | 230 ++ .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 39 + .../.toys.rb | 28 + .../.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-recaptcha_enterprise/Gemfile | 28 + .../LICENSE.md | 201 ++ .../README.md | 142 + .../Rakefile | 169 ++ .../google-cloud-recaptcha_enterprise.gemspec | 27 + .../lib/google-cloud-recaptcha_enterprise.rb | 19 + .../lib/google/cloud/recaptcha_enterprise.rb | 147 + .../cloud/recaptcha_enterprise/version.rb | 26 + .../cloud/recaptcha_enterprise/client_test.rb | 53 + .../recaptcha_enterprise/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 | 120 + ...loud-recommendation_engine-v1beta1.gemspec | 28 + ...gle-cloud-recommendation_engine-v1beta1.rb | 21 + .../cloud/recommendation_engine/v1beta1.rb | 48 + .../v1beta1/catalog_service.rb | 56 + .../v1beta1/catalog_service/client.rb | 1028 +++++++ .../v1beta1/catalog_service/credentials.rb | 51 + .../v1beta1/catalog_service/operations.rb | 841 ++++++ .../v1beta1/catalog_service/paths.rb | 73 + .../v1beta1/catalog_service/rest.rb | 53 + .../v1beta1/catalog_service/rest/client.rb | 943 ++++++ .../catalog_service/rest/operations.rb | 939 ++++++ .../catalog_service/rest/service_stub.rb | 450 +++ .../v1beta1/prediction_api_key_registry.rb | 59 + .../prediction_api_key_registry/client.rb | 693 +++++ .../credentials.rb | 51 + .../prediction_api_key_registry/paths.rb | 77 + .../prediction_api_key_registry/rest.rb | 56 + .../rest/client.rb | 629 ++++ .../rest/service_stub.rb | 265 ++ .../v1beta1/prediction_service.rb | 55 + .../v1beta1/prediction_service/client.rb | 575 ++++ .../v1beta1/prediction_service/credentials.rb | 51 + .../v1beta1/prediction_service/paths.rb | 56 + .../v1beta1/prediction_service/rest.rb | 52 + .../v1beta1/prediction_service/rest/client.rb | 525 ++++ .../prediction_service/rest/service_stub.rb | 143 + .../recommendation_engine/v1beta1/rest.rb | 40 + .../v1beta1/user_event_service.rb | 56 + .../v1beta1/user_event_service/client.rb | 1009 +++++++ .../v1beta1/user_event_service/credentials.rb | 51 + .../v1beta1/user_event_service/operations.rb | 841 ++++++ .../v1beta1/user_event_service/paths.rb | 54 + .../v1beta1/user_event_service/rest.rb | 53 + .../v1beta1/user_event_service/rest/client.rb | 931 ++++++ .../user_event_service/rest/operations.rb | 939 ++++++ .../user_event_service/rest/service_stub.rb | 389 +++ .../recommendation_engine/v1beta1/version.rb | 28 + .../v1beta1/catalog_pb.rb | 52 + .../v1beta1/catalog_service_pb.rb | 60 + .../v1beta1/catalog_service_services_pb.rb | 61 + .../recommendationengine/v1beta1/common_pb.rb | 44 + .../recommendationengine/v1beta1/import_pb.rb | 64 + .../prediction_apikey_registry_service_pb.rb | 53 + ...ion_apikey_registry_service_services_pb.rb | 53 + .../v1beta1/prediction_service_pb.rb | 53 + .../v1beta1/prediction_service_services_pb.rb | 48 + .../recommendationengine_resources_pb.rb | 43 + .../v1beta1/user_event_pb.rb | 56 + .../v1beta1/user_event_service_pb.rb | 60 + .../v1beta1/user_event_service_services_pb.rb | 66 + .../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 ++ .../recommendationengine/v1beta1/catalog.rb | 218 ++ .../v1beta1/catalog_service.rb | 110 + .../recommendationengine/v1beta1/common.rb | 89 + .../recommendationengine/v1beta1/import.rb | 212 ++ .../prediction_apikey_registry_service.rb | 88 + .../v1beta1/prediction_service.rb | 212 ++ .../v1beta1/user_event.rb | 367 +++ .../v1beta1/user_event_service.rb | 191 ++ .../google/longrunning/operations.rb | 191 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../catalog_service/create_catalog_item.rb | 47 + .../catalog_service/delete_catalog_item.rb | 47 + .../catalog_service/get_catalog_item.rb | 47 + .../catalog_service/import_catalog_items.rb | 54 + .../catalog_service/list_catalog_items.rb | 51 + .../catalog_service/update_catalog_item.rb | 47 + .../create_prediction_api_key_registration.rb | 47 + .../delete_prediction_api_key_registration.rb | 47 + .../list_prediction_api_key_registrations.rb | 51 + .../snippets/prediction_service/predict.rb | 51 + ...le.cloud.recommendationengine.v1beta1.json | 615 ++++ .../user_event_service/collect_user_event.rb | 47 + .../user_event_service/import_user_events.rb | 54 + .../user_event_service/list_user_events.rb | 51 + .../user_event_service/purge_user_events.rb | 54 + .../user_event_service/write_user_event.rb | 47 + .../catalog_service_operations_test.rb | 400 +++ .../v1beta1/catalog_service_paths_test.rb | 67 + .../v1beta1/catalog_service_rest_test.rb | 432 +++ .../v1beta1/catalog_service_test.rb | 494 ++++ .../prediction_api_key_registry_paths_test.rb | 67 + .../prediction_api_key_registry_rest_test.rb | 264 ++ .../prediction_api_key_registry_test.rb | 289 ++ .../v1beta1/prediction_service_paths_test.rb | 55 + .../v1beta1/prediction_service_rest_test.rb | 160 + .../v1beta1/prediction_service_test.rb | 181 ++ .../user_event_service_operations_test.rb | 400 +++ .../v1beta1/user_event_service_paths_test.rb | 55 + .../v1beta1/user_event_service_rest_test.rb | 381 +++ .../v1beta1/user_event_service_test.rb | 447 +++ .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.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-recommendation_engine.gemspec | 27 + .../lib/google-cloud-recommendation_engine.rb | 19 + .../lib/google/cloud/recommendation_engine.rb | 370 +++ .../cloud/recommendation_engine/version.rb | 26 + .../recommendation_engine/client_test.rb | 127 + .../recommendation_engine/version_test.rb | 26 + .../test/helper.rb | 25 + .../google-cloud-recommender-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-recommender-v1/.rubocop.yml | 33 + .../google-cloud-recommender-v1/.toys.rb | 28 + .../google-cloud-recommender-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-recommender-v1/CHANGELOG.md | 2 + .../google-cloud-recommender-v1/Gemfile | 11 + .../google-cloud-recommender-v1/LICENSE.md | 201 ++ .../google-cloud-recommender-v1/README.md | 154 + .../google-cloud-recommender-v1/Rakefile | 169 ++ .../gapic_metadata.json | 83 + .../google-cloud-recommender-v1.gemspec | 28 + .../lib/google-cloud-recommender-v1.rb | 21 + .../lib/google/cloud/recommender/v1.rb | 45 + .../google/cloud/recommender/v1/insight_pb.rb | 55 + .../recommender/v1/insight_type_config_pb.rb | 50 + .../cloud/recommender/v1/recommendation_pb.rb | 67 + .../cloud/recommender/v1/recommender.rb | 58 + .../recommender/v1/recommender/client.rb | 1837 ++++++++++++ .../recommender/v1/recommender/credentials.rb | 51 + .../cloud/recommender/v1/recommender/paths.rb | 457 +++ .../cloud/recommender/v1/recommender/rest.rb | 55 + .../recommender/v1/recommender/rest/client.rb | 1703 +++++++++++ .../v1/recommender/rest/service_stub.rb | 1145 ++++++++ .../recommender/v1/recommender_config_pb.rb | 50 + .../recommender/v1/recommender_service_pb.rb | 71 + .../v1/recommender_service_services_pb.rb | 122 + .../lib/google/cloud/recommender/v1/rest.rb | 37 + .../google/cloud/recommender/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/recommender/v1/insight.rb | 168 ++ .../recommender/v1/insight_type_config.rb | 88 + .../cloud/recommender/v1/recommendation.rb | 442 +++ .../recommender/v1/recommender_config.rb | 88 + .../recommender/v1/recommender_service.rb | 390 +++ .../proto_docs/google/protobuf/duration.rb | 98 + .../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/type/money.rb | 43 + .../snippets/Gemfile | 32 + .../snippets/recommender/get_insight.rb | 47 + .../recommender/get_insight_type_config.rb | 47 + .../recommender/get_recommendation.rb | 47 + .../recommender/get_recommender_config.rb | 47 + .../snippets/recommender/list_insights.rb | 51 + .../recommender/list_recommendations.rb | 51 + .../recommender/mark_insight_accepted.rb | 47 + .../mark_recommendation_claimed.rb | 47 + .../mark_recommendation_dismissed.rb | 47 + .../recommender/mark_recommendation_failed.rb | 47 + .../mark_recommendation_succeeded.rb | 47 + .../recommender/update_insight_type_config.rb | 47 + .../recommender/update_recommender_config.rb | 47 + ..._metadata_google.cloud.recommender.v1.json | 535 ++++ .../recommender/v1/recommender_paths_test.rb | 163 + .../recommender/v1/recommender_rest_test.rb | 820 ++++++ .../cloud/recommender/v1/recommender_test.rb | 906 ++++++ .../test/helper.rb | 25 + .../google-cloud-recommender/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-recommender/.rubocop.yml | 39 + .../google-cloud-recommender/.toys.rb | 28 + .../google-cloud-recommender/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-recommender/CHANGELOG.md | 2 + .../google-cloud-recommender/Gemfile | 28 + .../google-cloud-recommender/LICENSE.md | 201 ++ .../google-cloud-recommender/README.md | 142 + .../google-cloud-recommender/Rakefile | 169 ++ .../google-cloud-recommender.gemspec | 27 + .../lib/google-cloud-recommender.rb | 19 + .../lib/google/cloud/recommender.rb | 159 + .../lib/google/cloud/recommender/version.rb | 26 + .../google/cloud/recommender/client_test.rb | 64 + .../google/cloud/recommender/version_test.rb | 26 + .../google-cloud-recommender/test/helper.rb | 25 + .../google-cloud-redis-cluster-v1/.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-redis-cluster-v1/.toys.rb | 28 + .../google-cloud-redis-cluster-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-redis-cluster-v1/Gemfile | 11 + .../google-cloud-redis-cluster-v1/LICENSE.md | 201 ++ .../google-cloud-redis-cluster-v1/README.md | 153 + .../google-cloud-redis-cluster-v1/Rakefile | 169 ++ .../gapic_metadata.json | 88 + .../google-cloud-redis-cluster-v1.gemspec | 29 + .../lib/google-cloud-redis-cluster-v1.rb | 21 + .../lib/google/cloud/redis/cluster/v1.rb | 47 + .../redis/cluster/v1/bindings_override.rb | 77 + .../redis/cluster/v1/cloud_redis_cluster.rb | 72 + .../cluster/v1/cloud_redis_cluster/client.rb | 1958 +++++++++++++ .../v1/cloud_redis_cluster/credentials.rb | 49 + .../v1/cloud_redis_cluster/operations.rb | 843 ++++++ .../cluster/v1/cloud_redis_cluster/paths.rb | 229 ++ .../cluster/v1/cloud_redis_cluster/rest.rb | 70 + .../v1/cloud_redis_cluster/rest/client.rb | 1825 ++++++++++++ .../v1/cloud_redis_cluster/rest/operations.rb | 926 ++++++ .../cloud_redis_cluster/rest/service_stub.rb | 942 ++++++ .../cluster/v1/cloud_redis_cluster_pb.rb | 127 + .../v1/cloud_redis_cluster_services_pb.rb | 122 + .../lib/google/cloud/redis/cluster/v1/rest.rb | 40 + .../google/cloud/redis/cluster/v1/version.rb | 30 + .../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 ++ .../redis/cluster/v1/cloud_redis_cluster.rb | 1301 ++++++++ .../google/longrunning/operations.rb | 191 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/dayofweek.rb | 49 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../cloud_redis_cluster/backup_cluster.rb | 54 + .../cloud_redis_cluster/create_cluster.rb | 54 + .../cloud_redis_cluster/delete_backup.rb | 54 + .../cloud_redis_cluster/delete_cluster.rb | 54 + .../cloud_redis_cluster/export_backup.rb | 54 + .../cloud_redis_cluster/get_backup.rb | 47 + .../get_backup_collection.rb | 47 + .../cloud_redis_cluster/get_cluster.rb | 47 + .../get_cluster_certificate_authority.rb | 47 + .../list_backup_collections.rb | 51 + .../cloud_redis_cluster/list_backups.rb | 51 + .../cloud_redis_cluster/list_clusters.rb | 51 + .../reschedule_cluster_maintenance.rb | 54 + .../cloud_redis_cluster/update_cluster.rb | 54 + ...etadata_google.cloud.redis.cluster.v1.json | 575 ++++ .../v1/cloud_redis_cluster_operations_test.rb | 400 +++ .../v1/cloud_redis_cluster_paths_test.rb | 163 + .../v1/cloud_redis_cluster_rest_test.rb | 873 ++++++ .../cluster/v1/cloud_redis_cluster_test.rb | 1018 +++++++ .../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 | 153 + .../Rakefile | 169 ++ .../gapic_metadata.json | 88 + ...google-cloud-redis-cluster-v1beta1.gemspec | 29 + .../lib/google-cloud-redis-cluster-v1beta1.rb | 21 + .../lib/google/cloud/redis/cluster/v1beta1.rb | 47 + .../cluster/v1beta1/bindings_override.rb | 77 + .../cluster/v1beta1/cloud_redis_cluster.rb | 72 + .../v1beta1/cloud_redis_cluster/client.rb | 1958 +++++++++++++ .../cloud_redis_cluster/credentials.rb | 49 + .../v1beta1/cloud_redis_cluster/operations.rb | 843 ++++++ .../v1beta1/cloud_redis_cluster/paths.rb | 229 ++ .../v1beta1/cloud_redis_cluster/rest.rb | 70 + .../cloud_redis_cluster/rest/client.rb | 1825 ++++++++++++ .../cloud_redis_cluster/rest/operations.rb | 926 ++++++ .../cloud_redis_cluster/rest/service_stub.rb | 942 ++++++ .../cluster/v1beta1/cloud_redis_cluster_pb.rb | 127 + .../cloud_redis_cluster_services_pb.rb | 122 + .../cloud/redis/cluster/v1beta1/rest.rb | 40 + .../cloud/redis/cluster/v1beta1/version.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 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 ++ .../cluster/v1beta1/cloud_redis_cluster.rb | 1301 ++++++++ .../google/longrunning/operations.rb | 191 ++ .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/dayofweek.rb | 49 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../cloud_redis_cluster/backup_cluster.rb | 54 + .../cloud_redis_cluster/create_cluster.rb | 54 + .../cloud_redis_cluster/delete_backup.rb | 54 + .../cloud_redis_cluster/delete_cluster.rb | 54 + .../cloud_redis_cluster/export_backup.rb | 54 + .../cloud_redis_cluster/get_backup.rb | 47 + .../get_backup_collection.rb | 47 + .../cloud_redis_cluster/get_cluster.rb | 47 + .../get_cluster_certificate_authority.rb | 47 + .../list_backup_collections.rb | 51 + .../cloud_redis_cluster/list_backups.rb | 51 + .../cloud_redis_cluster/list_clusters.rb | 51 + .../reschedule_cluster_maintenance.rb | 54 + .../cloud_redis_cluster/update_cluster.rb | 54 + ...ta_google.cloud.redis.cluster.v1beta1.json | 575 ++++ .../cloud_redis_cluster_operations_test.rb | 400 +++ .../v1beta1/cloud_redis_cluster_paths_test.rb | 163 + .../v1beta1/cloud_redis_cluster_rest_test.rb | 873 ++++++ .../v1beta1/cloud_redis_cluster_test.rb | 1018 +++++++ .../test/helper.rb | 25 + .../google-cloud-redis-cluster/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-redis-cluster/.rubocop.yml | 39 + .../google-cloud-redis-cluster/.toys.rb | 28 + .../google-cloud-redis-cluster/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-redis-cluster/CHANGELOG.md | 2 + .../google-cloud-redis-cluster/Gemfile | 28 + .../google-cloud-redis-cluster/LICENSE.md | 201 ++ .../google-cloud-redis-cluster/README.md | 141 + .../google-cloud-redis-cluster/Rakefile | 169 ++ .../google-cloud-redis-cluster.gemspec | 27 + .../lib/google-cloud-redis-cluster.rb | 19 + .../lib/google/cloud/redis/cluster.rb | 172 ++ .../lib/google/cloud/redis/cluster/version.rb | 28 + .../google/cloud/redis/cluster/client_test.rb | 64 + .../cloud/redis/cluster/version_test.rb | 26 + .../google-cloud-redis-cluster/test/helper.rb | 25 + 865 files changed, 138956 insertions(+) create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb create mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/.gitignore create mode 100644 owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-private_catalog/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-private_catalog/.toys.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/.yardopts create mode 100644 owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-private_catalog/Gemfile create mode 100644 owl-bot-staging/google-cloud-private_catalog/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-private_catalog/README.md create mode 100644 owl-bot-staging/google-cloud-private_catalog/Rakefile create mode 100644 owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec create mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb create mode 100644 owl-bot-staging/google-cloud-private_catalog/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.gitignore create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.yardopts create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/Gemfile create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/README.md create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/Rakefile create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb create mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-profiler-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-profiler-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-profiler-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-profiler-v2/README.md create mode 100644 owl-bot-staging/google-cloud-profiler-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-v2.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-profiler/.gitignore create mode 100644 owl-bot-staging/google-cloud-profiler/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-profiler/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-profiler/.toys.rb create mode 100644 owl-bot-staging/google-cloud-profiler/.yardopts create mode 100644 owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-profiler/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-profiler/Gemfile create mode 100644 owl-bot-staging/google-cloud-profiler/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-profiler/README.md create mode 100644 owl-bot-staging/google-cloud-profiler/Rakefile create mode 100644 owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec create mode 100644 owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb create mode 100644 owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb create mode 100644 owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb create mode 100644 owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb create mode 100644 owl-bot-staging/google-cloud-profiler/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.gitignore create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/README.md create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/Rakefile create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb create mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.gitignore create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/README.md create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/Rakefile create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb create mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.gitignore create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.yardopts create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/README.md create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/Rakefile create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb create mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recommender-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recommender-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommender-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recommender-v1/README.md create mode 100644 owl-bot-staging/google-cloud-recommender-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-v1.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json create mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb create mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-recommender/.gitignore create mode 100644 owl-bot-staging/google-cloud-recommender/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-recommender/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-recommender/.toys.rb create mode 100644 owl-bot-staging/google-cloud-recommender/.yardopts create mode 100644 owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-recommender/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-recommender/Gemfile create mode 100644 owl-bot-staging/google-cloud-recommender/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-recommender/README.md create mode 100644 owl-bot-staging/google-cloud-recommender/Rakefile create mode 100644 owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec create mode 100644 owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb create mode 100644 owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb create mode 100644 owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb create mode 100644 owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb create mode 100644 owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb create mode 100644 owl-bot-staging/google-cloud-recommender/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-v1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis-cluster/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis-cluster/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster/README.md create mode 100644 owl-bot-staging/google-cloud-redis-cluster/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec create mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb create mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/helper.rb diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json new file mode 100644 index 000000000000..6afbbc507001 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "policytroubleshooter.googleapis.com", + "api_shortname": "policytroubleshooter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest", + "distribution_name": "google-cloud-policy_troubleshooter-v1", + "is_cloud": true, + "language": "ruby", + "name": "policytroubleshooter", + "name_pretty": "IAM Policy Troubleshooter V1 API", + "product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. Note that google-cloud-policy_troubleshooter-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-policy_troubleshooter instead. See the readme for more details.", + "ruby-cloud-env-prefix": "POLICY_TROUBLESHOOTER", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/troubleshooting-access", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml new file mode 100644 index 000000000000..ac23e0ef14cf --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts new file mode 100644 index 000000000000..645955e779fe --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="IAM Policy Troubleshooter 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-policy_troubleshooter-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..ff8f9b4e6e7c --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-policy_troubleshooter-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-policy_troubleshooter-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/policy_troubleshooter/v1" + +client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/policy_troubleshooter/v1" + +::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter-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/policy_troubleshooter/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md new file mode 100644 index 000000000000..74c95d4a9292 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the IAM Policy Troubleshooter V1 API + +API Client library for the IAM Policy Troubleshooter V1 API + +Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the IAM Policy Troubleshooter V1 API. Most users should consider using +the main client gem, +[google-cloud-policy_troubleshooter](https://rubygems.org/gems/google-cloud-policy_troubleshooter). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-policy_troubleshooter-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/policytroubleshooter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/policy_troubleshooter/v1" + +client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new +request = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) +response = client.troubleshoot_iam_policy request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam/docs/troubleshooting-access) +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/policy_troubleshooter/v1" +require "logger" + +client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-policy_troubleshooter-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-policy_troubleshooter`. +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-policy_troubleshooter-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-policy_troubleshooter-v1/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Rakefile new file mode 100644 index 000000000000..89eab86ad846 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["POLICY_TROUBLESHOOTER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["POLICY_TROUBLESHOOTER_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 POLICY_TROUBLESHOOTER_TEST_PROJECT=test123 POLICY_TROUBLESHOOTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" + ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["POLICY_TROUBLESHOOTER_PROJECT"] = project + ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] = project + ENV["POLICY_TROUBLESHOOTER_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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-policy_troubleshooter-v1" + header "google-cloud-policy_troubleshooter-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-policy_troubleshooter-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json new file mode 100644 index 000000000000..43ad259c5c3d --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json @@ -0,0 +1,23 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.policytroubleshooter.v1", + "libraryPackage": "::Google::Cloud::PolicyTroubleshooter::V1", + "services": { + "IamChecker": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ + "troubleshoot_iam_policy" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec new file mode 100644 index 000000000000..eb0a9718533d --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/policy_troubleshooter/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-policy_troubleshooter-v1" + gem.version = Google::Cloud::PolicyTroubleshooter::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. Note that google-cloud-policy_troubleshooter-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-policy_troubleshooter instead. See the readme for more details." + gem.summary = "API Client library for the IAM Policy Troubleshooter V1 API" + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.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-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb new file mode 100644 index 000000000000..aea1e33566bd --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-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/policy_troubleshooter/v1" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb new file mode 100644 index 000000000000..ff4c583dc243 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/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/policy_troubleshooter/v1/iam_checker" +require "google/cloud/policy_troubleshooter/v1/version" + +module Google + module Cloud + module PolicyTroubleshooter + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/policy_troubleshooter/v1" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/policy_troubleshooter/v1" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/policy_troubleshooter/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb new file mode 100644 index 000000000000..db5775e79068 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.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/policy_troubleshooter/v1/version" + +require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" +require "google/cloud/policy_troubleshooter/v1/iam_checker/client" +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + ## + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/policy_troubleshooter/v1/iam_checker" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + module IamChecker + end + end + end + end +end + +helper_path = ::File.join __dir__, "iam_checker", "helpers.rb" +require "google/cloud/policy_troubleshooter/v1/iam_checker/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb new file mode 100644 index 000000000000..a808ce7f8bf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb @@ -0,0 +1,476 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/policytroubleshooter/v1/checker_pb" + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + module IamChecker + ## + # Client for the IamChecker service. + # + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "policytroubleshooter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_checker_stub + + ## + # Configure the IamChecker Client class. + # + # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IamChecker clients + # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "PolicyTroubleshooter", "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: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.troubleshoot_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IamChecker Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @iam_checker_stub.universe_domain + end + + ## + # Create a new IamChecker client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IamChecker 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/policytroubleshooter/v1/checker_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @iam_checker_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @iam_checker_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_checker_stub.logger + end + + # Service calls + + ## + # Checks whether a principal has a specific permission for a specific + # resource, and explains why the principal does or does not have that + # permission. + # + # @overload troubleshoot_iam_policy(request, options = nil) + # Pass arguments to `troubleshoot_iam_policy` via a request object, either of type + # {::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload troubleshoot_iam_policy(access_tuple: nil) + # Pass arguments to `troubleshoot_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 access_tuple [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple, ::Hash] + # The information to use for checking whether a principal has a permission + # for a resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/policy_troubleshooter/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new + # + # # Call the troubleshoot_iam_policy method. + # result = client.troubleshoot_iam_policy request + # + # # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. + # p result + # + def troubleshoot_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.troubleshoot_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::PolicyTroubleshooter::V1::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.troubleshoot_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.troubleshoot_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_checker_stub.call_rpc :troubleshoot_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 + + ## + # Configuration class for the IamChecker API. + # + # This class represents the configuration for IamChecker, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # troubleshoot_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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 = "policytroubleshooter.googleapis.com" + + config_attr :endpoint, nil, ::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 IamChecker API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `troubleshoot_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :troubleshoot_iam_policy + + # @private + def initialize parent_rpcs = nil + troubleshoot_iam_policy_config = parent_rpcs.troubleshoot_iam_policy if parent_rpcs.respond_to? :troubleshoot_iam_policy + @troubleshoot_iam_policy = ::Gapic::Config::Method.new troubleshoot_iam_policy_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb new file mode 100644 index 000000000000..ea0bcf678236 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/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 PolicyTroubleshooter + module V1 + module IamChecker + # Credentials for the IamChecker API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "POLICY_TROUBLESHOOTER_CREDENTIALS", + "POLICY_TROUBLESHOOTER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "POLICY_TROUBLESHOOTER_CREDENTIALS_JSON", + "POLICY_TROUBLESHOOTER_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-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb new file mode 100644 index 000000000000..4e2e1e3897fa --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/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/policy_troubleshooter/v1/version" + +require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/client" + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + ## + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + module IamChecker + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb new file mode 100644 index 000000000000..6b02bbfc723b --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/policytroubleshooter/v1/checker_pb" +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub" + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + module IamChecker + module Rest + ## + # REST client for the IamChecker service. + # + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "policytroubleshooter.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_checker_stub + + ## + # Configure the IamChecker Client class. + # + # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IamChecker clients + # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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", "PolicyTroubleshooter", "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: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.troubleshoot_iam_policy.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IamChecker Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @iam_checker_stub.universe_domain + end + + ## + # Create a new IamChecker REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IamChecker client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @iam_checker_stub = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @iam_checker_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_checker_stub.logger + end + + # Service calls + + ## + # Checks whether a principal has a specific permission for a specific + # resource, and explains why the principal does or does not have that + # permission. + # + # @overload troubleshoot_iam_policy(request, options = nil) + # Pass arguments to `troubleshoot_iam_policy` via a request object, either of type + # {::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload troubleshoot_iam_policy(access_tuple: nil) + # Pass arguments to `troubleshoot_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 access_tuple [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple, ::Hash] + # The information to use for checking whether a principal has a permission + # for a resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/policy_troubleshooter/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new + # + # # Call the troubleshoot_iam_policy method. + # result = client.troubleshoot_iam_policy request + # + # # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. + # p result + # + def troubleshoot_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.troubleshoot_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::PolicyTroubleshooter::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.troubleshoot_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.troubleshoot_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_checker_stub.troubleshoot_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 + + ## + # Configuration class for the IamChecker REST API. + # + # This class represents the configuration for IamChecker 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::PolicyTroubleshooter::V1::IamChecker::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 + # # troubleshoot_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "policytroubleshooter.googleapis.com" + + config_attr :endpoint, nil, ::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 IamChecker API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `troubleshoot_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :troubleshoot_iam_policy + + # @private + def initialize parent_rpcs = nil + troubleshoot_iam_policy_config = parent_rpcs.troubleshoot_iam_policy if parent_rpcs.respond_to? :troubleshoot_iam_policy + @troubleshoot_iam_policy = ::Gapic::Config::Method.new troubleshoot_iam_policy_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb new file mode 100644 index 000000000000..e58eaa274bd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/policytroubleshooter/v1/checker_pb" + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + module IamChecker + module Rest + ## + # REST service stub for the IamChecker 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 troubleshoot_iam_policy REST call + # + # @param request_pb [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] + # A result object deserialized from the server's reply + def troubleshoot_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_troubleshoot_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: "troubleshoot_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.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 troubleshoot_iam_policy REST call + # + # @param request_pb [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_troubleshoot_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/iam:troubleshoot", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb new file mode 100644 index 000000000000..fdf326eb15b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" +require "google/cloud/policy_troubleshooter/v1/version" + +module Google + module Cloud + module PolicyTroubleshooter + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/policy_troubleshooter/v1/rest" + # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb new file mode 100644 index 000000000000..f222f8c6a79d --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/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 PolicyTroubleshooter + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb new file mode 100644 index 000000000000..1933957f8f97 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/policytroubleshooter/v1/checker.proto + +require 'google/protobuf' + +require 'google/cloud/policytroubleshooter/v1/explanations_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/cloud/policytroubleshooter/v1/checker.proto\x12$google.cloud.policytroubleshooter.v1\x1a\x37google/cloud/policytroubleshooter/v1/explanations.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x17google/rpc/status.proto\"g\n\x1cTroubleshootIamPolicyRequest\x12G\n\x0c\x61\x63\x63\x65ss_tuple\x18\x01 \x01(\x0b\x32\x31.google.cloud.policytroubleshooter.v1.AccessTuple\"\xd9\x01\n\x1dTroubleshootIamPolicyResponse\x12\x41\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessState\x12Q\n\x12\x65xplained_policies\x18\x02 \x03(\x0b\x32\x35.google.cloud.policytroubleshooter.v1.ExplainedPolicy\x12\"\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x12.google.rpc.Status2\xa9\x02\n\nIamChecker\x12\xc1\x01\n\x15TroubleshootIamPolicy\x12\x42.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest\x1a\x43.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/iam:troubleshoot:\x01*\x1aW\xca\x41#policytroubleshooter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x96\x02\n(com.google.cloud.policytroubleshooter.v1B\x0fIAMCheckerProtoP\x01Z\\cloud.google.com/go/policytroubleshooter/apiv1/policytroubleshooterpb;policytroubleshooterpb\xf8\x01\x01\xaa\x02$Google.Cloud.PolicyTroubleshooter.V1\xca\x02$Google\\Cloud\\PolicyTroubleshooter\\V1\xea\x02\'Google::Cloud::PolicyTroubleshooter::V1P\x00\x62\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.policytroubleshooter.v1.AccessTuple", "google/cloud/policytroubleshooter/v1/explanations.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 PolicyTroubleshooter + module V1 + TroubleshootIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest").msgclass + TroubleshootIamPolicyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb new file mode 100644 index 000000000000..ea050d9096d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/policytroubleshooter/v1/checker.proto for package 'Google.Cloud.PolicyTroubleshooter.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/policytroubleshooter/v1/checker_pb' + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + module IamChecker + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.policytroubleshooter.v1.IamChecker' + + # Checks whether a principal has a specific permission for a specific + # resource, and explains why the principal does or does not have that + # permission. + rpc :TroubleshootIamPolicy, ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb new file mode 100644 index 000000000000..ec390cf5fcbf --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/policytroubleshooter/v1/explanations.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/iam/v1/policy_pb' +require 'google/type/expr_pb' + + +descriptor_data = "\n7google/cloud/policytroubleshooter/v1/explanations.proto\x12$google.cloud.policytroubleshooter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x16google/type/expr.proto\"_\n\x0b\x41\x63\x63\x65ssTuple\x12\x16\n\tprincipal\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x66ull_resource_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\npermission\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xbc\x02\n\x0f\x45xplainedPolicy\x12\x41\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessState\x12\x1a\n\x12\x66ull_resource_name\x18\x02 \x01(\t\x12%\n\x06policy\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12V\n\x14\x62inding_explanations\x18\x04 \x03(\x0b\x32\x38.google.cloud.policytroubleshooter.v1.BindingExplanation\x12K\n\trelevance\x18\x05 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\"\x83\t\n\x12\x42indingExplanation\x12\x46\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessStateB\x03\xe0\x41\x02\x12\x0c\n\x04role\x18\x02 \x01(\t\x12`\n\x0frole_permission\x18\x03 \x01(\x0e\x32G.google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission\x12[\n\x19role_permission_relevance\x18\x04 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x12^\n\x0bmemberships\x18\x05 \x03(\x0b\x32I.google.cloud.policytroubleshooter.v1.BindingExplanation.MembershipsEntry\x12K\n\trelevance\x18\x06 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x12$\n\tcondition\x18\x07 \x01(\x0b\x32\x11.google.type.Expr\x1a\xbb\x01\n\x13\x41nnotatedMembership\x12W\n\nmembership\x18\x01 \x01(\x0e\x32\x43.google.cloud.policytroubleshooter.v1.BindingExplanation.Membership\x12K\n\trelevance\x18\x02 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x1a\x80\x01\n\x10MembershipsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12[\n\x05value\x18\x02 \x01(\x0b\x32L.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership:\x02\x38\x01\"\x9a\x01\n\x0eRolePermission\x12\x1f\n\x1bROLE_PERMISSION_UNSPECIFIED\x10\x00\x12\x1c\n\x18ROLE_PERMISSION_INCLUDED\x10\x01\x12 \n\x1cROLE_PERMISSION_NOT_INCLUDED\x10\x02\x12\'\n#ROLE_PERMISSION_UNKNOWN_INFO_DENIED\x10\x03\"\xa6\x01\n\nMembership\x12\x1a\n\x16MEMBERSHIP_UNSPECIFIED\x10\x00\x12\x17\n\x13MEMBERSHIP_INCLUDED\x10\x01\x12\x1b\n\x17MEMBERSHIP_NOT_INCLUDED\x10\x02\x12\"\n\x1eMEMBERSHIP_UNKNOWN_INFO_DENIED\x10\x03\x12\"\n\x1eMEMBERSHIP_UNKNOWN_UNSUPPORTED\x10\x04*{\n\x0b\x41\x63\x63\x65ssState\x12\x1c\n\x18\x41\x43\x43\x45SS_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07GRANTED\x10\x01\x12\x0f\n\x0bNOT_GRANTED\x10\x02\x12\x17\n\x13UNKNOWN_CONDITIONAL\x10\x03\x12\x17\n\x13UNKNOWN_INFO_DENIED\x10\x04*O\n\x12HeuristicRelevance\x12#\n\x1fHEURISTIC_RELEVANCE_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x42\xd6\x01Z\\cloud.google.com/go/policytroubleshooter/apiv1/policytroubleshooterpb;policytroubleshooterpb\xaa\x02$Google.Cloud.PolicyTroubleshooter.V1\xca\x02$Google\\Cloud\\PolicyTroubleshooter\\V1\xea\x02\'Google::Cloud::PolicyTroubleshooter::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.iam.v1.Policy", "google/iam/v1/policy.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 PolicyTroubleshooter + module V1 + AccessTuple = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.AccessTuple").msgclass + ExplainedPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.ExplainedPolicy").msgclass + BindingExplanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation").msgclass + BindingExplanation::AnnotatedMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership").msgclass + BindingExplanation::RolePermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission").enummodule + BindingExplanation::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.Membership").enummodule + AccessState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.AccessState").enummodule + HeuristicRelevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.HeuristicRelevance").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md new file mode 100644 index 000000000000..7f77420fe049 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# IAM Policy Troubleshooter 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-policy_troubleshooter-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb new file mode 100644 index 000000000000..af8cbc579260 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + # Request for + # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy TroubleshootIamPolicy}. + # @!attribute [rw] access_tuple + # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple] + # The information to use for checking whether a principal has a permission + # for a resource. + class TroubleshootIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for + # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy TroubleshootIamPolicy}. + # @!attribute [rw] access + # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] + # Indicates whether the principal has the specified permission for the + # specified resource, based on evaluating all of the applicable IAM policies. + # @!attribute [rw] explained_policies + # @return [::Array<::Google::Cloud::PolicyTroubleshooter::V1::ExplainedPolicy>] + # List of IAM policies that were evaluated to check the principal's + # permissions, with annotations to indicate how each policy contributed to + # the final result. + # + # The list of policies can include the policy for the resource itself. It can + # also include policies that are inherited from higher levels of the resource + # hierarchy, including the organization, the folder, and the project. + # + # To learn more about the resource hierarchy, see + # https://cloud.google.com/iam/help/resource-hierarchy. + # @!attribute [rw] errors + # @return [::Array<::Google::Rpc::Status>] + # The general errors contained in the troubleshooting response. + class TroubleshootIamPolicyResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb new file mode 100644 index 000000000000..f85ed31e20b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb @@ -0,0 +1,268 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PolicyTroubleshooter + module V1 + # Information about the principal, resource, and permission to check. + # @!attribute [rw] principal + # @return [::String] + # Required. The principal whose access you want to check, in the form of + # the email address that represents that principal. For example, + # `alice@example.com` or + # `my-service-account@my-project.iam.gserviceaccount.com`. + # + # The principal must be a Google Account or a service account. Other types of + # principals are not supported. + # @!attribute [rw] full_resource_name + # @return [::String] + # Required. The full resource name that identifies the resource. For example, + # `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + # + # For examples of full resource names for Google Cloud services, see + # https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + # @!attribute [rw] permission + # @return [::String] + # Required. The IAM permission to check for the specified principal and + # resource. + # + # For a complete list of IAM permissions, see + # https://cloud.google.com/iam/help/permissions/reference. + # + # For a complete list of predefined IAM roles and the permissions in each + # role, see https://cloud.google.com/iam/help/roles/reference. + class AccessTuple + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how a specific IAM [Policy][google.iam.v1.Policy] contributed + # to the access check. + # @!attribute [rw] access + # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] + # Indicates whether _this policy_ provides the specified permission to the + # specified principal for the specified resource. + # + # This field does _not_ indicate whether the principal actually has the + # permission for the resource. There might be another policy that overrides + # this policy. To determine whether the principal actually has the + # permission, use the `access` field in the + # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + # @!attribute [rw] full_resource_name + # @return [::String] + # The full resource name that identifies the resource. For example, + # `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + # + # If the sender of the request does not have access to the policy, this field + # is omitted. + # + # For examples of full resource names for Google Cloud services, see + # https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # The IAM policy attached to the resource. + # + # If the sender of the request does not have access to the policy, this field + # is empty. + # @!attribute [rw] binding_explanations + # @return [::Array<::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation>] + # Details about how each binding in the policy affects the principal's + # ability, or inability, to use the permission for the resource. + # + # If the sender of the request does not have access to the policy, this field + # is omitted. + # @!attribute [rw] relevance + # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] + # The relevance of this policy to the overall determination in the + # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + # + # If the sender of the request does not have access to the policy, this field + # is omitted. + class ExplainedPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how a binding in a policy affects a principal's ability to use + # a permission. + # @!attribute [rw] access + # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] + # Required. Indicates whether _this binding_ provides the specified + # permission to the specified principal for the specified resource. + # + # This field does _not_ indicate whether the principal actually has the + # permission for the resource. There might be another binding that overrides + # this binding. To determine whether the principal actually has the + # permission, use the `access` field in the + # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + # @!attribute [rw] role + # @return [::String] + # The role that this binding grants. For example, + # `roles/compute.serviceAgent`. + # + # For a complete list of predefined IAM roles, as well as the permissions in + # each role, see https://cloud.google.com/iam/help/roles/reference. + # @!attribute [rw] role_permission + # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::RolePermission] + # Indicates whether the role granted by this binding contains the specified + # permission. + # @!attribute [rw] role_permission_relevance + # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] + # The relevance of the permission's existence, or nonexistence, in the role + # to the overall determination for the entire policy. + # @!attribute [rw] memberships + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::AnnotatedMembership}] + # Indicates whether each principal in the binding includes the principal + # specified in the request, either directly or indirectly. Each key + # identifies a principal in the binding, and each value indicates whether the + # principal in the binding includes the principal in the request. + # + # For example, suppose that a binding includes the following principals: + # + # * `user:alice@example.com` + # * `group:product-eng@example.com` + # + # You want to troubleshoot access for `user:bob@example.com`. This user is a + # principal of the group `group:product-eng@example.com`. + # + # For the first principal in the binding, the key is + # `user:alice@example.com`, and the `membership` field in the value is set to + # `MEMBERSHIP_NOT_INCLUDED`. + # + # For the second principal in the binding, the key is + # `group:product-eng@example.com`, and the `membership` field in the value is + # set to `MEMBERSHIP_INCLUDED`. + # @!attribute [rw] relevance + # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] + # The relevance of this binding to the overall determination for the entire + # policy. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # A condition expression that prevents this binding from granting access + # unless the expression evaluates to `true`. + # + # To learn about IAM Conditions, see + # https://cloud.google.com/iam/help/conditions/overview. + class BindingExplanation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details about whether the binding includes the principal. + # @!attribute [rw] membership + # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::Membership] + # Indicates whether the binding includes the principal. + # @!attribute [rw] relevance + # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] + # The relevance of the principal's status to the overall determination for + # the binding. + class AnnotatedMembership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::AnnotatedMembership] + class MembershipsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Whether a role includes a specific permission. + module RolePermission + # Default value. This value is unused. + ROLE_PERMISSION_UNSPECIFIED = 0 + + # The permission is included in the role. + ROLE_PERMISSION_INCLUDED = 1 + + # The permission is not included in the role. + ROLE_PERMISSION_NOT_INCLUDED = 2 + + # The sender of the request is not allowed to access the binding. + ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3 + end + + # Whether the binding includes the principal. + module Membership + # Default value. This value is unused. + MEMBERSHIP_UNSPECIFIED = 0 + + # The binding includes the principal. The principal can be included + # directly or indirectly. For example: + # + # * A principal is included directly if that principal is listed in the + # binding. + # * A principal is included indirectly if that principal is in a Google + # group or Google Workspace domain that is listed in the binding. + MEMBERSHIP_INCLUDED = 1 + + # The binding does not include the principal. + MEMBERSHIP_NOT_INCLUDED = 2 + + # The sender of the request is not allowed to access the binding. + MEMBERSHIP_UNKNOWN_INFO_DENIED = 3 + + # The principal is an unsupported type. Only Google Accounts and service + # accounts are supported. + MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4 + end + end + + # Whether a principal has a permission for a resource. + module AccessState + # Default value. This value is unused. + ACCESS_STATE_UNSPECIFIED = 0 + + # The principal has the permission. + GRANTED = 1 + + # The principal does not have the permission. + NOT_GRANTED = 2 + + # The principal has the permission only if a condition expression evaluates + # to `true`. + UNKNOWN_CONDITIONAL = 3 + + # The sender of the request does not have access to all of the policies that + # Policy Troubleshooter needs to evaluate. + UNKNOWN_INFO_DENIED = 4 + end + + # The extent to which a single data point, such as the existence of a binding + # or whether a binding includes a specific principal, contributes to an overall + # determination. + module HeuristicRelevance + # Default value. This value is unused. + HEURISTIC_RELEVANCE_UNSPECIFIED = 0 + + # The data point has a limited effect on the result. Changing the data point + # is unlikely to affect the overall determination. + NORMAL = 1 + + # The data point has a strong effect on the result. Changing the data point + # is likely to affect the overall determination. + HIGH = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/Gemfile new file mode 100644 index 000000000000..663c510dbf5e --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1", path: "../" +else + gem "google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb new file mode 100644 index 000000000000..ec04da284cc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_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 policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] +require "google/cloud/policy_troubleshooter/v1" + +## +# Snippet for the troubleshoot_iam_policy call in the IamChecker service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy. +# +def troubleshoot_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new + + # Call the troubleshoot_iam_policy method. + result = client.troubleshoot_iam_policy request + + # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. + p result +end +# [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json new file mode 100644 index 000000000000..dde6c1e2f061 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json @@ -0,0 +1,55 @@ +{ + "client_library": { + "name": "google-cloud-policy_troubleshooter-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.policytroubleshooter.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync", + "title": "Snippet for the troubleshoot_iam_policy call in the IamChecker service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy.", + "file": "iam_checker/troubleshoot_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "troubleshoot_iam_policy", + "full_name": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse", + "client": { + "short_name": "IamChecker::Client", + "full_name": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client" + }, + "method": { + "short_name": "TroubleshootIamPolicy", + "full_name": "google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy", + "service": { + "short_name": "IamChecker", + "full_name": "google.cloud.policytroubleshooter.v1.IamChecker" + } + } + }, + "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-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb new file mode 100644 index 000000000000..6eeebe353276 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/policytroubleshooter/v1/checker_pb" +require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" + + +class ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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_troubleshoot_iam_policy + # Create test objects. + client_result = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + access_tuple = {} + + troubleshoot_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::PolicyTroubleshooter::V1::IamChecker::Rest::ServiceStub.stub :transcode_troubleshoot_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, troubleshoot_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.troubleshoot_iam_policy({ access_tuple: access_tuple }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.troubleshoot_iam_policy access_tuple: access_tuple do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.troubleshoot_iam_policy ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.troubleshoot_iam_policy({ access_tuple: access_tuple }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.troubleshoot_iam_policy(::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, troubleshoot_iam_policy_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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb new file mode 100644 index 000000000000..894ec8205435 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/policytroubleshooter/v1/checker_pb" +require "google/cloud/policy_troubleshooter/v1/iam_checker" + +class ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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_troubleshoot_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + access_tuple = {} + + troubleshoot_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :troubleshoot_iam_policy, name + assert_kind_of ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple), request["access_tuple"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, troubleshoot_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.troubleshoot_iam_policy({ access_tuple: access_tuple }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.troubleshoot_iam_policy access_tuple: access_tuple do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.troubleshoot_iam_policy ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.troubleshoot_iam_policy({ access_tuple: access_tuple }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.troubleshoot_iam_policy(::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, troubleshoot_iam_policy_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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json new file mode 100644 index 000000000000..c47f4da4c33a --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "policytroubleshooter.googleapis.com", + "api_shortname": "policytroubleshooter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam/latest", + "distribution_name": "google-cloud-policy_troubleshooter-iam", + "is_cloud": true, + "language": "ruby", + "name": "policytroubleshooter", + "name_pretty": "Policy Troubleshooter API", + "product_documentation": "https://cloud.google.com/policy-intelligence/docs/troubleshoot-access", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API.", + "ruby-cloud-product-url": "https://cloud.google.com/policy-intelligence/docs/troubleshoot-access", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml new file mode 100644 index 000000000000..e4518405b0ab --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-policy_troubleshooter-iam.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-policy_troubleshooter-iam.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts new file mode 100644 index 000000000000..f28b50b2ea64 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Policy Troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md new file mode 100644 index 000000000000..28ac37859c3f --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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/policy_troubleshooter/iam" + +client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/policy_troubleshooter/iam" + +Google::Cloud::PolicyTroubleshooter::Iam.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter +``` + +### 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-policy_troubleshooter-iam +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/policy_troubleshooter/iam" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter +``` + +### 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile new file mode 100644 index 000000000000..a6d541a39eee --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-policy_troubleshooter-iam-v3"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-policy_troubleshooter-iam.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md new file mode 100644 index 000000000000..aa8f773a89c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Policy Troubleshooter API + +API Client library for the Policy Troubleshooter API + +google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-policy_troubleshooter-iam-v*`. +The gem `google-cloud-policy_troubleshooter-iam` 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-policy_troubleshooter-iam/latest) +for this library, google-cloud-policy_troubleshooter-iam, 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-policy_troubleshooter-iam-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest). + +See also the [Product Documentation](https://cloud.google.com/policy-intelligence/docs/troubleshoot-access) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-policy_troubleshooter-iam +``` + +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/policytroubleshooter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/policy_troubleshooter/iam" + +client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter +request = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) +response = client.troubleshoot_iam_policy 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-policy_troubleshooter-iam-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter-iam`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter-iam`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile new file mode 100644 index 000000000000..015ce07af372 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter-iam 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/policy_troubleshooter/iam/v3/policy_troubleshooter/credentials" + ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-policy_troubleshooter-iam" + header "google-cloud-policy_troubleshooter-iam rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-policy_troubleshooter-iam yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec new file mode 100644 index 000000000000..b40aaad45bb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/policy_troubleshooter/iam/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-policy_troubleshooter-iam" + gem.version = Google::Cloud::PolicyTroubleshooter::Iam::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API." + gem.summary = "API Client library for the Policy Troubleshooter 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-policy_troubleshooter-iam-v3", ">= 0.3", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb new file mode 100644 index 000000000000..fc0fb2397c75 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.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/policy_troubleshooter/iam" unless defined? Google::Cloud::PolicyTroubleshooter::Iam::VERSION diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb new file mode 100644 index 000000000000..44d3d533f173 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.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 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/policy_troubleshooter/iam/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! :policy_troubleshooter_iam 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 PolicyTroubleshooter + module Iam + ## + # Create a new client object for PolicyTroubleshooter. + # + # By default, this returns an instance of + # [Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Cloud-PolicyTroubleshooter-Iam-V3-PolicyTroubleshooter-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 PolicyTroubleshooter 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 PolicyTroubleshooter service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_available?}. + # + # ## About PolicyTroubleshooter + # + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud 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.policy_troubleshooter version: :v3, transport: :grpc, &block + require "google/cloud/policy_troubleshooter/iam/#{version.to_s.downcase}" + + package_name = Google::Cloud::PolicyTroubleshooter::Iam + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::PolicyTroubleshooter::Iam.const_get(package_name).const_get(:PolicyTroubleshooter) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PolicyTroubleshooter service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PolicyTroubleshooter service, + # or if the versioned client gem needs an update to support the PolicyTroubleshooter 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.policy_troubleshooter_available? version: :v3, transport: :grpc + require "google/cloud/policy_troubleshooter/iam/#{version.to_s.downcase}" + package_name = Google::Cloud::PolicyTroubleshooter::Iam + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::PolicyTroubleshooter::Iam.const_get package_name + return false unless service_module.const_defined? :PolicyTroubleshooter + service_module = service_module.const_get :PolicyTroubleshooter + 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-policy_troubleshooter-iam 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.policy_troubleshooter_iam if block_given? + + ::Google::Cloud.configure.policy_troubleshooter_iam + end + end + end + end +end + +helper_path = ::File.join __dir__, "iam", "helpers.rb" +require "google/cloud/policy_troubleshooter/iam/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb new file mode 100644 index 000000000000..79cc2faf17d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/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 PolicyTroubleshooter + module Iam + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb new file mode 100644 index 000000000000..78a1d06c1db9 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/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/policy_troubleshooter/iam" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::PolicyTroubleshooter::Iam::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_policy_troubleshooter_grpc + skip unless Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_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::PolicyTroubleshooter::Iam.policy_troubleshooter transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client, client + end + end + + def test_policy_troubleshooter_rest + skip unless Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb new file mode 100644 index 000000000000..cb5c62d423b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/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/policy_troubleshooter/iam/version" + +class Google::Cloud::PolicyTroubleshooter::Iam::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::PolicyTroubleshooter::Iam::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.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-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json new file mode 100644 index 000000000000..9ac44371e219 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "policytroubleshooter.googleapis.com", + "api_shortname": "policytroubleshooter", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter/latest", + "distribution_name": "google-cloud-policy_troubleshooter", + "is_cloud": true, + "language": "ruby", + "name": "policytroubleshooter", + "name_pretty": "IAM Policy Troubleshooter API", + "product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles.", + "ruby-cloud-env-prefix": "POLICY_TROUBLESHOOTER", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/troubleshooting-access", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml new file mode 100644 index 000000000000..9b012e2b5610 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-policy_troubleshooter.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-policy_troubleshooter.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.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-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts new file mode 100644 index 000000000000..7f48b4ccc854 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="IAM Policy Troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md new file mode 100644 index 000000000000..74d90fd5d123 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-policy_troubleshooter 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-policy_troubleshooter 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/policy_troubleshooter" + +client = Google::Cloud::PolicyTroubleshooter.iam_checker do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/policy_troubleshooter" + +Google::Cloud::PolicyTroubleshooter.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::PolicyTroubleshooter.iam_checker +``` + +### 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-policy_troubleshooter +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/policy_troubleshooter" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::PolicyTroubleshooter.iam_checker +``` + +### 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-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile new file mode 100644 index 000000000000..6bea76c13c23 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-policy_troubleshooter-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-policy_troubleshooter.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-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md new file mode 100644 index 000000000000..984a8b7ad507 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the IAM Policy Troubleshooter API + +API Client library for the IAM Policy Troubleshooter API + +Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-policy_troubleshooter-v*`. +The gem `google-cloud-policy_troubleshooter` 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-policy_troubleshooter/latest) +for this library, google-cloud-policy_troubleshooter, 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-policy_troubleshooter-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/iam/docs/troubleshooting-access) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-policy_troubleshooter +``` + +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/policytroubleshooter.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/policy_troubleshooter" + +client = Google::Cloud::PolicyTroubleshooter.iam_checker +request = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) +response = client.troubleshoot_iam_policy 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-policy_troubleshooter-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-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-policy_troubleshooter`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-policy_troubleshooter-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-policy_troubleshooter`. +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-policy_troubleshooter-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-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile new file mode 100644 index 000000000000..640387ccb27d --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-policy_troubleshooter acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["POLICY_TROUBLESHOOTER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["POLICY_TROUBLESHOOTER_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 POLICY_TROUBLESHOOTER_TEST_PROJECT=test123 POLICY_TROUBLESHOOTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" + ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["POLICY_TROUBLESHOOTER_PROJECT"] = project + ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] = project + ENV["POLICY_TROUBLESHOOTER_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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-policy_troubleshooter" + header "google-cloud-policy_troubleshooter rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-policy_troubleshooter yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec new file mode 100644 index 000000000000..f634d596469e --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/policy_troubleshooter/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-policy_troubleshooter" + gem.version = Google::Cloud::PolicyTroubleshooter::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles." + gem.summary = "API Client library for the IAM Policy Troubleshooter 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-policy_troubleshooter-v1", ">= 0.10", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb new file mode 100644 index 000000000000..19fbbe0a4894 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.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/policy_troubleshooter" unless defined? Google::Cloud::PolicyTroubleshooter::VERSION diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb new file mode 100644 index 000000000000..e523e06cb76c --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.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/policy_troubleshooter/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! :policy_troubleshooter 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 PolicyTroubleshooter + ## + # Create a new client object for IamChecker. + # + # By default, this returns an instance of + # [Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest/Google-Cloud-PolicyTroubleshooter-V1-IamChecker-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 IamChecker 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 IamChecker service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::PolicyTroubleshooter.iam_checker_available?}. + # + # ## About IamChecker + # + # IAM Policy Troubleshooter service. + # + # This service helps you troubleshoot access issues for Google Cloud resources. + # + # @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.iam_checker version: :v1, transport: :grpc, &block + require "google/cloud/policy_troubleshooter/#{version.to_s.downcase}" + + package_name = Google::Cloud::PolicyTroubleshooter + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::PolicyTroubleshooter.const_get(package_name).const_get(:IamChecker) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the IamChecker service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::PolicyTroubleshooter.iam_checker}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the IamChecker service, + # or if the versioned client gem needs an update to support the IamChecker 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.iam_checker_available? version: :v1, transport: :grpc + require "google/cloud/policy_troubleshooter/#{version.to_s.downcase}" + package_name = Google::Cloud::PolicyTroubleshooter + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::PolicyTroubleshooter.const_get package_name + return false unless service_module.const_defined? :IamChecker + service_module = service_module.const_get :IamChecker + 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-policy_troubleshooter 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.policy_troubleshooter if block_given? + + ::Google::Cloud.configure.policy_troubleshooter + end + end + end +end + +helper_path = ::File.join __dir__, "policy_troubleshooter", "helpers.rb" +require "google/cloud/policy_troubleshooter/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb new file mode 100644 index 000000000000..595795835e5a --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/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 PolicyTroubleshooter + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb new file mode 100644 index 000000000000..de8c17a5ec96 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/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/policy_troubleshooter" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::PolicyTroubleshooter::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_iam_checker_grpc + skip unless Google::Cloud::PolicyTroubleshooter.iam_checker_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::PolicyTroubleshooter.iam_checker transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client, client + end + end + + def test_iam_checker_rest + skip unless Google::Cloud::PolicyTroubleshooter.iam_checker_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::PolicyTroubleshooter.iam_checker transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb new file mode 100644 index 000000000000..ab6405e39f79 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/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/policy_troubleshooter/version" + +class Google::Cloud::PolicyTroubleshooter::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::PolicyTroubleshooter::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-private_catalog-v1beta1/.gitignore b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..cd71d7c86d70 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudprivatecatalog.googleapis.com", + "api_shortname": "cloudprivatecatalog", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest", + "distribution_name": "google-cloud-private_catalog-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "cloudprivatecatalog", + "name_pretty": "Private Catalog V1beta1 API", + "product_documentation": "https://cloud.google.com/private-catalog/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. Note that google-cloud-private_catalog-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-private_catalog instead. See the readme for more details.", + "ruby-cloud-env-prefix": "PRIVATE_CATALOG", + "ruby-cloud-product-url": "https://cloud.google.com/private-catalog/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..709811bdd0ab --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-private_catalog-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-private_catalog-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/.yardopts b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts new file mode 100644 index 000000000000..2362fe73205d --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Private Catalog 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-private_catalog-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..c3b5087e0c4f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-private_catalog-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-private_catalog-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/private_catalog/v1beta1" + +client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/private_catalog/v1beta1" + +::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog-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/private_catalog/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/README.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md new file mode 100644 index 000000000000..1112c9ba65ef --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Private Catalog V1beta1 API + +Enable cloud users to discover private catalogs and products in their organizations. + +With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Private Catalog V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-private_catalog](https://rubygems.org/gems/google-cloud-private_catalog). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-private_catalog-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/cloudprivatecatalog.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/private_catalog/v1beta1" + +client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new +request = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new # (request fields as keyword arguments...) +response = client.search_catalogs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/private-catalog/) +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/private_catalog/v1beta1" +require "logger" + +client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-private_catalog-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-private_catalog`. +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-private_catalog-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-private_catalog-v1beta1/Rakefile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile new file mode 100644 index 000000000000..edb1a7f8207b --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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-private_catalog-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PRIVATE_CATALOG_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PRIVATE_CATALOG_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PRIVATE_CATALOG_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_CATALOG_TEST_PROJECT=test123 PRIVATE_CATALOG_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" + ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PRIVATE_CATALOG_PROJECT"] = project + ENV["PRIVATE_CATALOG_TEST_PROJECT"] = project + ENV["PRIVATE_CATALOG_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-private_catalog-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-private_catalog-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-private_catalog-v1beta1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-private_catalog-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-private_catalog-v1beta1" + header "google-cloud-private_catalog-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-private_catalog-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-private_catalog-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-private_catalog-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-private_catalog-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-private_catalog-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..eec768d32fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.privatecatalog.v1beta1", + "libraryPackage": "::Google::Cloud::PrivateCatalog::V1beta1", + "services": { + "PrivateCatalog": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client", + "rpcs": { + "SearchCatalogs": { + "methods": [ + "search_catalogs" + ] + }, + "SearchProducts": { + "methods": [ + "search_products" + ] + }, + "SearchVersions": { + "methods": [ + "search_versions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec b/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec new file mode 100644 index 000000000000..90cb5cfa1e3f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/private_catalog/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-private_catalog-v1beta1" + gem.version = Google::Cloud::PrivateCatalog::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. Note that google-cloud-private_catalog-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-private_catalog instead. See the readme for more details." + gem.summary = "Enable cloud users to discover private catalogs and products in their organizations." + 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-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb new file mode 100644 index 000000000000..cd1f53ddc55b --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-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/private_catalog/v1beta1" diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb new file mode 100644 index 000000000000..a53ec341f0a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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/private_catalog/v1beta1/private_catalog" +require "google/cloud/private_catalog/v1beta1/version" + +module Google + module Cloud + module PrivateCatalog + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/private_catalog/v1beta1" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/private_catalog/v1beta1" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/private_catalog/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb new file mode 100644 index 000000000000..02ca08f093c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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/private_catalog/v1beta1/version" + +require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" +require "google/cloud/private_catalog/v1beta1/private_catalog/client" +require "google/cloud/private_catalog/v1beta1/private_catalog/rest" + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + ## + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/private_catalog/v1beta1/private_catalog" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/private_catalog/v1beta1/private_catalog/rest" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + module PrivateCatalog + end + end + end + end +end + +helper_path = ::File.join __dir__, "private_catalog", "helpers.rb" +require "google/cloud/private_catalog/v1beta1/private_catalog/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb new file mode 100644 index 000000000000..8e74775b6691 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb @@ -0,0 +1,738 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + module PrivateCatalog + ## + # Client for the PrivateCatalog service. + # + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprivatecatalog.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :private_catalog_stub + + ## + # Configure the PrivateCatalog Client class. + # + # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrivateCatalog clients + # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "PrivateCatalog", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrivateCatalog Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @private_catalog_stub.universe_domain + end + + ## + # Create a new PrivateCatalog client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrivateCatalog 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/privatecatalog/v1beta1/private_catalog_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 + + @private_catalog_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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 + ) + + @private_catalog_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 + @private_catalog_stub.logger + end + + # Service calls + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Catalog Catalog} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_catalogs(request, options = nil) + # Pass arguments to `search_catalogs` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalogs(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. It can be in following formats: + # + # * `projects/{project}` + # * `folders/{folder}` + # * `organizations/{organization}` + # @param query [::String] + # The query to filter the catalogs. The supported queries are: + # + # * Get a single catalog: `name=catalogs/{catalog}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchCatalogs 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::PrivateCatalog::V1beta1::Catalog>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new + # + # # Call the search_catalogs method. + # result = client.search_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::PrivateCatalog::V1beta1::Catalog. + # p item + # end + # + def search_catalogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest + + # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION + metadata[:"x-goog-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.search_catalogs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_catalogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.call_rpc :search_catalogs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Product Product} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_products(request, options = nil) + # Pass arguments to `search_products` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @param query [::String] + # The query to filter the products. + # + # The supported queries are: + # * List products of all catalogs: empty + # * List products under a catalog: `parent=catalogs/{catalog}` + # * Get a product by name: + # `name=catalogs/{catalog}/products/{product}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchProducts 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::PrivateCatalog::V1beta1::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new + # + # # Call the search_products method. + # result = client.search_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::PrivateCatalog::V1beta1::Product. + # p item + # end + # + def search_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest + + # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION + metadata[:"x-goog-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.search_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.call_rpc :search_products, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Version Version} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_versions(request, options = nil) + # Pass arguments to `search_versions` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_versions(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @param query [::String] + # Required. The query to filter the versions. + # + # The supported queries are: + # * List versions under a product: + # `parent=catalogs/{catalog}/products/{product}` + # * Get a version by name: + # `name=catalogs/{catalog}/products/{product}/versions/{version}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchVersions + # 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::PrivateCatalog::V1beta1::Version>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Version>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new + # + # # Call the search_versions method. + # result = client.search_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::PrivateCatalog::V1beta1::Version. + # p item + # end + # + def search_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest + + # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION + metadata[:"x-goog-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.search_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.call_rpc :search_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Configuration class for the PrivateCatalog API. + # + # This class represents the configuration for PrivateCatalog, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_catalogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_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::PrivateCatalog::V1beta1::PrivateCatalog::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 = "cloudprivatecatalog.googleapis.com" + + config_attr :endpoint, nil, ::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 PrivateCatalog API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_catalogs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_catalogs + ## + # RPC-specific configuration for `search_products` + # @return [::Gapic::Config::Method] + # + attr_reader :search_products + ## + # RPC-specific configuration for `search_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_versions + + # @private + def initialize parent_rpcs = nil + search_catalogs_config = parent_rpcs.search_catalogs if parent_rpcs.respond_to? :search_catalogs + @search_catalogs = ::Gapic::Config::Method.new search_catalogs_config + search_products_config = parent_rpcs.search_products if parent_rpcs.respond_to? :search_products + @search_products = ::Gapic::Config::Method.new search_products_config + search_versions_config = parent_rpcs.search_versions if parent_rpcs.respond_to? :search_versions + @search_versions = ::Gapic::Config::Method.new search_versions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb new file mode 100644 index 000000000000..14bdc9599325 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/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 PrivateCatalog + module V1beta1 + module PrivateCatalog + # Credentials for the PrivateCatalog API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "PRIVATE_CATALOG_CREDENTIALS", + "PRIVATE_CATALOG_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PRIVATE_CATALOG_CREDENTIALS_JSON", + "PRIVATE_CATALOG_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-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb new file mode 100644 index 000000000000..96b9df075ca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/private_catalog/v1beta1/version" + +require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" +require "google/cloud/private_catalog/v1beta1/private_catalog/rest/client" + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + ## + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/private_catalog/v1beta1/private_catalog/rest" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + module PrivateCatalog + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/private_catalog/v1beta1/private_catalog/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb new file mode 100644 index 000000000000..1922e509478f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb @@ -0,0 +1,674 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" +require "google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub" + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + module PrivateCatalog + module Rest + ## + # REST client for the PrivateCatalog service. + # + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprivatecatalog.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :private_catalog_stub + + ## + # Configure the PrivateCatalog Client class. + # + # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrivateCatalog clients + # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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", "PrivateCatalog", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrivateCatalog Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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 + @private_catalog_stub.universe_domain + end + + ## + # Create a new PrivateCatalog REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrivateCatalog 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 + + @private_catalog_stub = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @private_catalog_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 + @private_catalog_stub.logger + end + + # Service calls + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Catalog Catalog} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_catalogs(request, options = nil) + # Pass arguments to `search_catalogs` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalogs(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. It can be in following formats: + # + # * `projects/{project}` + # * `folders/{folder}` + # * `organizations/{organization}` + # @param query [::String] + # The query to filter the catalogs. The supported queries are: + # + # * Get a single catalog: `name=catalogs/{catalog}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchCatalogs 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::PrivateCatalog::V1beta1::Catalog>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new + # + # # Call the search_catalogs method. + # result = client.search_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::PrivateCatalog::V1beta1::Catalog. + # p item + # end + # + def search_catalogs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest + + # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_catalogs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_catalogs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.search_catalogs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Product Product} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_products(request, options = nil) + # Pass arguments to `search_products` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @param query [::String] + # The query to filter the products. + # + # The supported queries are: + # * List products of all catalogs: empty + # * List products under a catalog: `parent=catalogs/{catalog}` + # * Get a product by name: + # `name=catalogs/{catalog}/products/{product}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchProducts 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::PrivateCatalog::V1beta1::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new + # + # # Call the search_products method. + # result = client.search_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::PrivateCatalog::V1beta1::Product. + # p item + # end + # + def search_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest + + # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.search_products request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Search {::Google::Cloud::PrivateCatalog::V1beta1::Version Version} resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + # + # @overload search_versions(request, options = nil) + # Pass arguments to `search_versions` via a request object, either of type + # {::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_versions(resource: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_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 resource [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @param query [::String] + # Required. The query to filter the versions. + # + # The supported queries are: + # * List versions under a product: + # `parent=catalogs/{catalog}/products/{product}` + # * Get a version by name: + # `name=catalogs/{catalog}/products/{product}/versions/{version}` + # @param page_size [::Integer] + # The maximum number of entries that are requested. + # @param page_token [::String] + # A pagination token returned from a previous call to SearchVersions + # 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::PrivateCatalog::V1beta1::Version>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Version>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/private_catalog/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new + # + # # Call the search_versions method. + # result = client.search_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::PrivateCatalog::V1beta1::Version. + # p item + # end + # + def search_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest + + # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @private_catalog_stub.search_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 + + ## + # Configuration class for the PrivateCatalog REST API. + # + # This class represents the configuration for PrivateCatalog 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::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalogs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_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 = "cloudprivatecatalog.googleapis.com" + + config_attr :endpoint, nil, ::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 PrivateCatalog API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_catalogs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_catalogs + ## + # RPC-specific configuration for `search_products` + # @return [::Gapic::Config::Method] + # + attr_reader :search_products + ## + # RPC-specific configuration for `search_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_versions + + # @private + def initialize parent_rpcs = nil + search_catalogs_config = parent_rpcs.search_catalogs if parent_rpcs.respond_to? :search_catalogs + @search_catalogs = ::Gapic::Config::Method.new search_catalogs_config + search_products_config = parent_rpcs.search_products if parent_rpcs.respond_to? :search_products + @search_products = ::Gapic::Config::Method.new search_products_config + search_versions_config = parent_rpcs.search_versions if parent_rpcs.respond_to? :search_versions + @search_versions = ::Gapic::Config::Method.new search_versions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb new file mode 100644 index 000000000000..61885c21605f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb @@ -0,0 +1,306 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + module PrivateCatalog + module Rest + ## + # REST service stub for the PrivateCatalog 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_catalogs REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse] + # A result object deserialized from the server's reply + def search_catalogs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_catalogs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.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_products REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse] + # A result object deserialized from the server's reply + def search_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_products", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.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_versions REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse] + # A result object deserialized from the server's reply + def search_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.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_catalogs REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest] + # 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_catalogs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/catalogs:search", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/catalogs:search", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/catalogs:search", + matches: [ + ["resource", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_products REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest] + # 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_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/products:search", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/products:search", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/products:search", + matches: [ + ["resource", %r{^folders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_versions REST call + # + # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest] + # 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_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/versions:search", + matches: [ + ["resource", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/versions:search", + matches: [ + ["resource", %r{^organizations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{resource}/versions:search", + 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-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb new file mode 100644 index 000000000000..515801f56a70 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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/private_catalog/v1beta1/private_catalog/rest" +require "google/cloud/private_catalog/v1beta1/version" + +module Google + module Cloud + module PrivateCatalog + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/private_catalog/v1beta1/rest" + # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb new file mode 100644 index 000000000000..90c36fd71e0f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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 PrivateCatalog + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb new file mode 100644 index 000000000000..542c71cd7f3e --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/privatecatalog/v1beta1/private_catalog.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/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/privatecatalog/v1beta1/private_catalog.proto\x12#google.cloud.privatecatalog.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\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"d\n\x15SearchCatalogsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchCatalogsResponse\x12>\n\x08\x63\x61talogs\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Catalog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x15SearchProductsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchProductsResponse\x12>\n\x08products\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x15SearchVersionsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Version\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x82\x02\n\x07\x43\x61talog\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\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:C\xea\x41@\n*cloudprivatecatalog.googleapis.com/Catalog\x12\x12\x63\x61talogs/{catalog}\"\x8c\x03\n\x07Product\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nasset_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10\x64isplay_metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x06\xe0\x41\x02\xe0\x41\x03\x12\x15\n\x08icon_uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12R\n\x10\x61sset_references\x18\n \x03(\x0b\x32\x33.google.cloud.privatecatalog.v1beta1.AssetReferenceB\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:C\xea\x41@\n*cloudprivatecatalog.googleapis.com/Product\x12\x12products/{product}\"\xde\x05\n\x0e\x41ssetReference\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12@\n\x06inputs\x18\x06 \x01(\x0b\x32+.google.cloud.privatecatalog.v1beta1.InputsB\x03\xe0\x41\x03\x12h\n\x11validation_status\x18\x07 \x01(\x0e\x32H.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationStateB\x03\xe0\x41\x03\x12@\n\x14validation_operation\x18\x08 \x01(\x0b\x32\x1d.google.longrunning.OperationB\x03\xe0\x41\x03\x12\x14\n\x05\x61sset\x18\n \x01(\tB\x03\xe0\x41\x03H\x00\x12\x19\n\x08gcs_path\x18\x0b \x01(\tB\x05\x18\x01\xe0\x41\x03H\x00\x12I\n\ngit_source\x18\x0f \x01(\x0b\x32..google.cloud.privatecatalog.v1beta1.GitSourceB\x03\xe0\x41\x03H\x00\x12G\n\ngcs_source\x18\x10 \x01(\x0b\x32..google.cloud.privatecatalog.v1beta1.GcsSourceB\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\x12\x13\n\x07version\x18\x0e \x01(\tB\x02\x18\x01\"c\n\x14\x41ssetValidationState\x12&\n\"ASSET_VALIDATION_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\t\n\x05VALID\x10\x02\x12\x0b\n\x07INVALID\x10\x03\x42\x08\n\x06source\":\n\x06Inputs\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\"q\n\tGcsSource\x12\x15\n\x08gcs_path\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\ngeneration\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"`\n\tGitSource\x12\x0c\n\x04repo\x18\x01 \x01(\t\x12\x0b\n\x03\x64ir\x18\x02 \x01(\t\x12\x10\n\x06\x63ommit\x18\x03 \x01(\tH\x00\x12\x10\n\x06\x62ranch\x18\x04 \x01(\tH\x00\x12\r\n\x03tag\x18\x05 \x01(\tH\x00\x42\x05\n\x03ref\"\xba\x02\n\x07Version\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12+\n\x05\x61sset\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\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:i\xea\x41\x66\n*cloudprivatecatalog.googleapis.com/Version\x12\x38\x63\x61talogs/{catalog}/products/{product}/versions/{version}2\xf2\x07\n\x0ePrivateCatalog\x12\xab\x02\n\x0eSearchCatalogs\x12:.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/catalogs:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/catalogs:searchZ/\x12-/v1beta1/{resource=folders/*}/catalogs:search\x12\xab\x02\n\x0eSearchProducts\x12:.google.cloud.privatecatalog.v1beta1.SearchProductsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchProductsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/products:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/products:searchZ/\x12-/v1beta1/{resource=folders/*}/products:search\x12\xab\x02\n\x0eSearchVersions\x12:.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/versions:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/versions:searchZ/\x12-/v1beta1/{resource=folders/*}/versions:search\x1aV\xca\x41\"cloudprivatecatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n\'com.google.cloud.privatecatalog.v1beta1B\x13PrivateCatalogProtoP\x01ZOcloud.google.com/go/privatecatalog/apiv1beta1/privatecatalogpb;privatecatalogpb\xaa\x02#Google.Cloud.PrivateCatalog.V1Beta1\xca\x02#Google\\Cloud\\PrivateCatalog\\V1beta1\xea\x02&Google::Cloud::PrivateCatalog::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.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.longrunning.Operation", "google/longrunning/operations.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 PrivateCatalog + module V1beta1 + SearchCatalogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest").msgclass + SearchCatalogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse").msgclass + SearchProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchProductsRequest").msgclass + SearchProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchProductsResponse").msgclass + SearchVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchVersionsRequest").msgclass + SearchVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchVersionsResponse").msgclass + Catalog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Catalog").msgclass + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Product").msgclass + AssetReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.AssetReference").msgclass + AssetReference::AssetValidationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState").enummodule + Inputs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Inputs").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.GcsSource").msgclass + GitSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.GitSource").msgclass + Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Version").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb new file mode 100644 index 000000000000..25a007cc31fc --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/privatecatalog/v1beta1/private_catalog.proto for package 'Google.Cloud.PrivateCatalog.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/privatecatalog/v1beta1/private_catalog_pb' + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + module PrivateCatalog + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' + + # Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + rpc :SearchCatalogs, ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse + # Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + rpc :SearchProducts, ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse + # Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the + # scope of the consumer cloud resource hierarchy context. + rpc :SearchVersions, ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..12926d84ac6d --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Private Catalog 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-private_catalog-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb new file mode 100644 index 000000000000..26e75b65725b --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb @@ -0,0 +1,506 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PrivateCatalog + module V1beta1 + # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs PrivateCatalog.SearchCatalogs}. + # @!attribute [rw] resource + # @return [::String] + # Required. The name of the resource context. It can be in following formats: + # + # * `projects/{project}` + # * `folders/{folder}` + # * `organizations/{organization}` + # @!attribute [rw] query + # @return [::String] + # The query to filter the catalogs. The supported queries are: + # + # * Get a single catalog: `name=catalogs/{catalog}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of entries that are requested. + # @!attribute [rw] page_token + # @return [::String] + # A pagination token returned from a previous call to SearchCatalogs that + # indicates where this listing should continue from. + class SearchCatalogsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs PrivateCatalog.SearchCatalogs}. + # @!attribute [rw] catalogs + # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] + # The `Catalog`s computed from the resource context. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to SearchCatalogs that + # indicates from where listing should continue. + class SearchCatalogsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products PrivateCatalog.SearchProducts}. + # @!attribute [rw] resource + # @return [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @!attribute [rw] query + # @return [::String] + # The query to filter the products. + # + # The supported queries are: + # * List products of all catalogs: empty + # * List products under a catalog: `parent=catalogs/{catalog}` + # * Get a product by name: + # `name=catalogs/{catalog}/products/{product}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of entries that are requested. + # @!attribute [rw] page_token + # @return [::String] + # A pagination token returned from a previous call to SearchProducts that + # indicates where this listing should continue from. + class SearchProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products PrivateCatalog.SearchProducts}. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Product>] + # The `Product` resources computed from the resource context. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to SearchProducts that + # indicates from where listing should continue. + class SearchProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions PrivateCatalog.SearchVersions}. + # @!attribute [rw] resource + # @return [::String] + # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} + # for details. + # @!attribute [rw] query + # @return [::String] + # Required. The query to filter the versions. + # + # The supported queries are: + # * List versions under a product: + # `parent=catalogs/{catalog}/products/{product}` + # * Get a version by name: + # `name=catalogs/{catalog}/products/{product}/versions/{version}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of entries that are requested. + # @!attribute [rw] page_token + # @return [::String] + # A pagination token returned from a previous call to SearchVersions + # that indicates where this listing should continue from. + class SearchVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions PrivateCatalog.SearchVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Version>] + # The `Version` resources computed from the resource context. + # @!attribute [rw] next_page_token + # @return [::String] + # A pagination token returned from a previous call to SearchVersions that + # indicates from where the listing should continue. + class SearchVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The readonly representation of a catalog computed with a given resource + # context. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the target catalog, in the format of + # `catalogs/{catalog}`. + # @!attribute [r] display_name + # @return [::String] + # Output only. The descriptive name of the catalog as it appears in UIs. + # @!attribute [r] description + # @return [::String] + # Output only. The description of the catalog. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the catalog was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the catalog was last updated. + class Catalog + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The readonly representation of a product computed with a given resource + # context. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the target product, in the format of + # `products/[a-z][-a-z0-9]*[a-z0-9]'. + # + # A unique identifier for the product under a catalog. + # @!attribute [r] asset_type + # @return [::String] + # Output only. The type of the product asset. It can be one of the following values: + # + # * `google.deploymentmanager.Template` + # * `google.cloudprivatecatalog.ListingOnly` + # * `google.cloudprivatecatalog.Terraform` + # @!attribute [r] display_metadata + # @return [::Google::Protobuf::Struct] + # Required. Output only. The display metadata to describe the product. The JSON schema of the + # metadata differs by {::Google::Cloud::PrivateCatalog::V1beta1::Product#asset_type Product.asset_type}. + # When the type is `google.deploymentmanager.Template`, the schema is as + # follows: + # + # ``` + # "$schema": http://json-schema.org/draft-04/schema# + # type: object + # properties: + # name: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # tagline: + # type: string + # minLength: 1 + # maxLength: 100 + # support_info: + # type: string + # minLength: 1 + # maxLength: 2048 + # creator: + # type: string + # minLength: 1 + # maxLength: 100 + # documentations: + # type: array + # items: + # type: object + # properties: + # url: + # type: string + # pattern: + # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + # title: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # required: + # - name + # - description + # additionalProperties: false + # + # ``` + # + # When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema + # is as follows: + # + # ``` + # "$schema": http://json-schema.org/draft-04/schema# + # type: object + # properties: + # name: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # tagline: + # type: string + # minLength: 1 + # maxLength: 100 + # support_info: + # type: string + # minLength: 1 + # maxLength: 2048 + # creator: + # type: string + # minLength: 1 + # maxLength: 100 + # documentations: + # type: array + # items: + # type: object + # properties: + # url: + # type: string + # pattern: + # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + # title: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # signup_url: + # type: string + # pattern: + # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + # required: + # - name + # - description + # - signup_url + # additionalProperties: false + # + # ``` + # + # When the asset type is `google.cloudprivatecatalog.Terraform`, the schema + # is as follows: + # + # ``` + # "$schema": http://json-schema.org/draft-04/schema# + # type: object + # properties: + # name: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # tagline: + # type: string + # minLength: 1 + # maxLength: 100 + # support_info: + # type: string + # minLength: 1 + # maxLength: 2048 + # creator: + # type: string + # minLength: 1 + # maxLength: 100 + # documentations: + # type: array + # items: + # type: object + # properties: + # url: + # type: string + # pattern: + # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" + # title: + # type: string + # minLength: 1 + # maxLength: 64 + # description: + # type: string + # minLength: 1 + # maxLength: 2048 + # required: + # - name + # - description + # additionalProperties: true + # @!attribute [r] icon_uri + # @return [::String] + # Output only. The icon URI of the product. + # @!attribute [r] asset_references + # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::AssetReference>] + # Output only. A collection of assets referred by a product. + # This field is set for Terraform Products only. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the product was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the product was last updated. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the reference of an asset belonging to a product. + # @!attribute [r] id + # @return [::String] + # Output only. A unique identifier among asset references in a product. + # @!attribute [r] description + # @return [::String] + # Output only. The human-readable description of the referenced asset. Maximum 256 + # characters in length. + # @!attribute [r] inputs + # @return [::Google::Cloud::PrivateCatalog::V1beta1::Inputs] + # Output only. The definition of input parameters to hydrate the asset template. + # @!attribute [r] validation_status + # @return [::Google::Cloud::PrivateCatalog::V1beta1::AssetReference::AssetValidationState] + # Output only. The current state of the asset reference. + # @!attribute [r] validation_operation + # @return [::Google::Longrunning::Operation] + # Output only. The validation process metadata. + # @!attribute [r] asset + # @return [::String] + # Output only. The asset resource name if an asset is hosted by Private Catalog. + # + # Note: The following fields are mutually exclusive: `asset`, `gcs_path`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] gcs_path + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. The cloud storage object path. + # + # Note: The following fields are mutually exclusive: `gcs_path`, `asset`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] git_source + # @return [::Google::Cloud::PrivateCatalog::V1beta1::GitSource] + # Output only. The git source. + # + # Note: The following fields are mutually exclusive: `git_source`, `asset`, `gcs_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] gcs_source + # @return [::Google::Cloud::PrivateCatalog::V1beta1::GcsSource] + # Output only. The cloud storage source. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation timestamp of the asset reference. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last update timestamp of the asset reference. + # @!attribute [rw] version + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # The version of the source used for this asset reference. + class AssetReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible validation steates of an asset reference. + module AssetValidationState + # Unknown state. + ASSET_VALIDATION_STATE_UNSPECIFIED = 0 + + # The validation is still in process. + PENDING = 1 + + # The validation is done and the asset reference is valid. + VALID = 2 + + # The validation is done and the asset reference is invalid. + INVALID = 3 + end + end + + # Defines definition of input parameters of asset templates. + # @!attribute [r] parameters + # @return [::Google::Protobuf::Struct] + # Output only. The JSON schema defining the inputs and their formats. + class Inputs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines how to access Cloud Storage source. + # @!attribute [r] gcs_path + # @return [::String] + # Output only. the cloud storage object path. + # @!attribute [r] generation + # @return [::Integer] + # Output only. Generation of the object, which is set when the content of an object starts + # being written. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the object metadata was last changed. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines how to access a Git Source. + # @!attribute [rw] repo + # @return [::String] + # Location of the Git repo to build. + # @!attribute [rw] dir + # @return [::String] + # Directory, relative to the source root, in which to run the build. + # + # This must be a relative path. If a step's `dir` is specified and is an + # absolute path, this value is ignored for that step's execution. + # @!attribute [rw] commit + # @return [::String] + # The revision commit to use. + # + # Note: The following fields are mutually exclusive: `commit`, `branch`, `tag`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] branch + # @return [::String] + # The revision branch to use. + # + # Note: The following fields are mutually exclusive: `branch`, `commit`, `tag`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tag + # @return [::String] + # The revision tag to use. + # + # Note: The following fields are mutually exclusive: `tag`, `commit`, `branch`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class GitSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The consumer representation of a version which is a child resource under a + # `Product` with asset data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the version, in the format + # `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. + # + # A unique identifier for the version under a product. + # @!attribute [r] description + # @return [::String] + # Output only. The user-supplied description of the version. Maximum of 256 + # characters. + # @!attribute [r] asset + # @return [::Google::Protobuf::Struct] + # Output only. The asset which has been validated and is ready to be + # provisioned. See + # [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the version was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the version was last updated. + class Version + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/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-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..db299e20cc99 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1", path: "../" +else + gem "google-cloud-private_catalog-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-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb new file mode 100644 index 000000000000..34578aef9f37 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] +require "google/cloud/private_catalog/v1beta1" + +## +# Snippet for the search_catalogs call in the PrivateCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs. +# +def search_catalogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new + + # Call the search_catalogs method. + result = client.search_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::PrivateCatalog::V1beta1::Catalog. + p item + end +end +# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb new file mode 100644 index 000000000000..fabb9ad7546f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] +require "google/cloud/private_catalog/v1beta1" + +## +# Snippet for the search_products call in the PrivateCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products. +# +def search_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new + + # Call the search_products method. + result = client.search_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::PrivateCatalog::V1beta1::Product. + p item + end +end +# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb new file mode 100644 index 000000000000..84d57f05f511 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] +require "google/cloud/private_catalog/v1beta1" + +## +# Snippet for the search_versions call in the PrivateCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions. +# +def search_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new + + # Call the search_versions method. + result = client.search_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::PrivateCatalog::V1beta1::Version. + p item + end +end +# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json new file mode 100644 index 000000000000..f8b5399663ab --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-private_catalog-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.privatecatalog.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync", + "title": "Snippet for the search_catalogs call in the PrivateCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs.", + "file": "private_catalog/search_catalogs.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_catalogs", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse", + "client": { + "short_name": "PrivateCatalog::Client", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" + }, + "method": { + "short_name": "SearchCatalogs", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs", + "service": { + "short_name": "PrivateCatalog", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync", + "title": "Snippet for the search_products call in the PrivateCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products.", + "file": "private_catalog/search_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_products", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse", + "client": { + "short_name": "PrivateCatalog::Client", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" + }, + "method": { + "short_name": "SearchProducts", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts", + "service": { + "short_name": "PrivateCatalog", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync", + "title": "Snippet for the search_versions call in the PrivateCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions.", + "file": "private_catalog/search_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_versions", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse", + "client": { + "short_name": "PrivateCatalog::Client", + "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" + }, + "method": { + "short_name": "SearchVersions", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions", + "service": { + "short_name": "PrivateCatalog", + "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb new file mode 100644 index 000000000000..ca3d8dfc853f --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb @@ -0,0 +1,270 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/privatecatalog/v1beta1/private_catalog_pb" +require "google/cloud/private_catalog/v1beta1/private_catalog/rest" + + +class ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs + # Create test objects. + client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_catalogs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_catalogs_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_catalogs resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_catalogs ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_catalogs(::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_catalogs_client_stub.call_count + end + end + end + + def test_search_products + # Create test objects. + client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_products_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_products resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_products ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_products(::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_products_client_stub.call_count + end + end + end + + def test_search_versions + # Create test objects. + client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_versions_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_versions resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_versions ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_versions(::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_versions_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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb new file mode 100644 index 000000000000..22364fedecae --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb @@ -0,0 +1,311 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" +require "google/cloud/private_catalog/v1beta1/private_catalog" + +class ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_catalogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_catalogs, name + assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, request + assert_equal "hello world", request["resource"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_catalogs_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_catalogs resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_catalogs ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_catalogs(::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_catalogs_client_stub.call_rpc_count + end + end + + def test_search_products + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_products, name + assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, request + assert_equal "hello world", request["resource"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_products_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_products resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_products ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_products(::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_products_client_stub.call_rpc_count + end + end + + def test_search_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_versions, name + assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_versions_client_stub do + # Create client + client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_versions resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_versions ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_versions(::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_versions_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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog-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-private_catalog/.gitignore b/owl-bot-staging/google-cloud-private_catalog/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/.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-private_catalog/.repo-metadata.json b/owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json new file mode 100644 index 000000000000..c79da2444afc --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudprivatecatalog.googleapis.com", + "api_shortname": "cloudprivatecatalog", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog/latest", + "distribution_name": "google-cloud-private_catalog", + "is_cloud": true, + "language": "ruby", + "name": "cloudprivatecatalog", + "name_pretty": "Private Catalog API", + "product_documentation": "https://cloud.google.com/private-catalog/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions.", + "ruby-cloud-env-prefix": "PRIVATE_CATALOG", + "ruby-cloud-product-url": "https://cloud.google.com/private-catalog/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml b/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml new file mode 100644 index 000000000000..aa19d4f0b67e --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-private_catalog.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-private_catalog.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-private_catalog/.toys.rb b/owl-bot-staging/google-cloud-private_catalog/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/.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-private_catalog/.yardopts b/owl-bot-staging/google-cloud-private_catalog/.yardopts new file mode 100644 index 000000000000..3550f0f7990c --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Private Catalog 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-private_catalog/AUTHENTICATION.md b/owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md new file mode 100644 index 000000000000..408135d89769 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-private_catalog 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-private_catalog 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/private_catalog" + +client = Google::Cloud::PrivateCatalog.private_catalog do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/private_catalog" + +Google::Cloud::PrivateCatalog.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::PrivateCatalog.private_catalog +``` + +### 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-private_catalog +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/private_catalog" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::PrivateCatalog.private_catalog +``` + +### 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-private_catalog/CHANGELOG.md b/owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-private_catalog/Gemfile b/owl-bot-staging/google-cloud-private_catalog/Gemfile new file mode 100644 index 000000000000..990f39dd582a --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-private_catalog-v1beta1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-private_catalog.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-private_catalog/LICENSE.md b/owl-bot-staging/google-cloud-private_catalog/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/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-private_catalog/README.md b/owl-bot-staging/google-cloud-private_catalog/README.md new file mode 100644 index 000000000000..3c60d74a9187 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Private Catalog API + +API Client library for the Private Catalog API + +With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-private_catalog-v*`. +The gem `google-cloud-private_catalog` 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-private_catalog/latest) +for this library, google-cloud-private_catalog, 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-private_catalog-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest). + +See also the [Product Documentation](https://cloud.google.com/private-catalog/) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-private_catalog +``` + +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/cloudprivatecatalog.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/private_catalog" + +client = Google::Cloud::PrivateCatalog.private_catalog +request = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new # (request fields as keyword arguments...) +response = client.search_catalogs 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-private_catalog-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-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-private_catalog`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-private_catalog-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-private_catalog`. +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-private_catalog-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-private_catalog/Rakefile b/owl-bot-staging/google-cloud-private_catalog/Rakefile new file mode 100644 index 000000000000..53d72b9896f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/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-private_catalog acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PRIVATE_CATALOG_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PRIVATE_CATALOG_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PRIVATE_CATALOG_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_CATALOG_TEST_PROJECT=test123 PRIVATE_CATALOG_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" + ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PRIVATE_CATALOG_PROJECT"] = project + ENV["PRIVATE_CATALOG_TEST_PROJECT"] = project + ENV["PRIVATE_CATALOG_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-private_catalog 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-private_catalog 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-private_catalog 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-private_catalog gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-private_catalog" + header "google-cloud-private_catalog rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-private_catalog yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-private_catalog 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-private_catalog 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-private_catalog 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-private_catalog/google-cloud-private_catalog.gemspec b/owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec new file mode 100644 index 000000000000..b345acf533b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/private_catalog/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-private_catalog" + gem.version = Google::Cloud::PrivateCatalog::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions." + gem.summary = "API Client library for the Private Catalog 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-private_catalog-v1beta1", ">= 0.6", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb new file mode 100644 index 000000000000..3ca9f4cd94c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.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/private_catalog" unless defined? Google::Cloud::PrivateCatalog::VERSION diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb new file mode 100644 index 000000000000..93931800cb10 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.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 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/private_catalog/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! :private_catalog 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 PrivateCatalog + ## + # Create a new client object for PrivateCatalog. + # + # By default, this returns an instance of + # [Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest/Google-Cloud-PrivateCatalog-V1beta1-PrivateCatalog-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 PrivateCatalog 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 PrivateCatalog service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::PrivateCatalog.private_catalog_available?}. + # + # ## About PrivateCatalog + # + # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` + # and `Version` resources under a target resource context. + # + # `Catalog` is computed based on the [Association][]s linked to the target + # resource and its ancestors. Each association's + # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a + # `Catalog`. If multiple associations have the same parent + # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are + # de-duplicated into one `Catalog`. Users must have + # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource + # context in order to access catalogs. `Catalog` contains the resource name and + # a subset of data of the original + # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. + # + # `Product` is child resource of the catalog. A `Product` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Product][]. + # + # `Version` is child resource of the product. A `Version` contains the resource + # name and a subset of the data of the original + # [google.cloud.privatecatalogproducer.v1beta.Version][]. + # + # @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.private_catalog version: :v1beta1, transport: :grpc, &block + require "google/cloud/private_catalog/#{version.to_s.downcase}" + + package_name = Google::Cloud::PrivateCatalog + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::PrivateCatalog.const_get(package_name).const_get(:PrivateCatalog) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PrivateCatalog service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::PrivateCatalog.private_catalog}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PrivateCatalog service, + # or if the versioned client gem needs an update to support the PrivateCatalog 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.private_catalog_available? version: :v1beta1, transport: :grpc + require "google/cloud/private_catalog/#{version.to_s.downcase}" + package_name = Google::Cloud::PrivateCatalog + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::PrivateCatalog.const_get package_name + return false unless service_module.const_defined? :PrivateCatalog + service_module = service_module.const_get :PrivateCatalog + 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-private_catalog 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.private_catalog if block_given? + + ::Google::Cloud.configure.private_catalog + end + end + end +end + +helper_path = ::File.join __dir__, "private_catalog", "helpers.rb" +require "google/cloud/private_catalog/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb new file mode 100644 index 000000000000..39ede99747f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/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 PrivateCatalog + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb new file mode 100644 index 000000000000..7188011b20f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/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/private_catalog" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::PrivateCatalog::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_private_catalog_grpc + skip unless Google::Cloud::PrivateCatalog.private_catalog_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::PrivateCatalog.private_catalog transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client, client + end + end + + def test_private_catalog_rest + skip unless Google::Cloud::PrivateCatalog.private_catalog_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::PrivateCatalog.private_catalog transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb new file mode 100644 index 000000000000..99cdfaacf464 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/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/private_catalog/version" + +class Google::Cloud::PrivateCatalog::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::PrivateCatalog::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/helper.rb b/owl-bot-staging/google-cloud-private_catalog/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-private_catalog/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-privileged_access_manager-v1/.gitignore b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json new file mode 100644 index 000000000000..7c7c8627c372 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "privilegedaccessmanager.googleapis.com", + "api_shortname": "privilegedaccessmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest", + "distribution_name": "google-cloud-privileged_access_manager-v1", + "is_cloud": true, + "language": "ruby", + "name": "privilegedaccessmanager", + "name_pretty": "Privileged Access Manager V1 API", + "product_documentation": "https://cloud.google.com/iam/docs/pam-overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes. Note that google-cloud-privileged_access_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-privileged_access_manager instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/pam-overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml new file mode 100644 index 000000000000..f7dd4380a15f --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-privileged_access_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-privileged_access_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/.yardopts b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts new file mode 100644 index 000000000000..af5d864c24be --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Privileged Access 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-privileged_access_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..42bfb575df5d --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1" + +client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/privileged_access_manager/v1" + +::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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/privileged_access_manager/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/README.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md new file mode 100644 index 000000000000..4ccbf222fe3e --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md @@ -0,0 +1,201 @@ +# Ruby Client for the Privileged Access Manager V1 API + +Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more. + +## Overview + +Privileged Access Manager (PAM) is a Google Cloud native, managed solution +to secure, manage and audit privileged access while ensuring operational +velocity and developer productivity. + +PAM enables just-in-time, time-bound, approval-based access elevations, +and auditing of privileged access elevations and activity. PAM lets you +define the rules of who can request access, what they can request access +to, and if they should be granted access with or without approvals based +on the sensitivity of the access and emergency of the situation. + +## Concepts + +### Entitlement + +An entitlement is an eligibility or license that allows specified users +(requesters) to request and obtain access to specified resources subject +to a set of conditions such as duration, etc. entitlements can be granted +to both human and non-human principals. + +### Grant + +A grant is an instance of active usage against the entitlement. A user can +place a request for a grant against an entitlement. The request may be +forwarded to an approver for their decision. Once approved, the grant is +activated, ultimately giving the user access (roles/permissions) on a +resource per the criteria specified in entitlement. + +### How does PAM work + +PAM creates and uses a service agent (Google-managed service account) to +perform the required IAM policy changes for granting access at a +specific +resource/access scope. The service agent requires getIAMPolicy and +setIAMPolicy permissions at the appropriate (or higher) access scope +- +Organization/Folder/Project to make policy changes on the resources listed +in PAM entitlements. + +When enabling PAM for a resource scope, the user/ principal performing +that action should have the appropriate permissions at that resource +scope +(resourcemanager.\\{projects|folders|organizations}.setIamPolicy, +resourcemanager.\\{projects|folders|organizations}.getIamPolicy, and +resourcemanager.\\{projects|folders|organizations}.get) to list and grant +the service agent/account the required access to perform IAM policy +changes. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Privileged Access Manager V1 API. Most users should consider using +the main client gem, +[google-cloud-privileged_access_manager](https://rubygems.org/gems/google-cloud-privileged_access_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-privileged_access_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/privilegedaccessmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/privileged_access_manager/v1" + +client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new +request = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new # (request fields as keyword arguments...) +response = client.check_onboarding_status request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam/docs/pam-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/privileged_access_manager/v1" +require "logger" + +client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1/Rakefile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/Rakefile new file mode 100644 index 000000000000..2eed1b886eca --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1/privileged_access_manager/credentials" + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-privileged_access_manager-v1" + header "google-cloud-privileged_access_manager-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-privileged_access_manager-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json new file mode 100644 index 000000000000..1db4bf616dc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.privilegedaccessmanager.v1", + "libraryPackage": "::Google::Cloud::PrivilegedAccessManager::V1", + "services": { + "PrivilegedAccessManager": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client", + "rpcs": { + "CheckOnboardingStatus": { + "methods": [ + "check_onboarding_status" + ] + }, + "ListEntitlements": { + "methods": [ + "list_entitlements" + ] + }, + "SearchEntitlements": { + "methods": [ + "search_entitlements" + ] + }, + "GetEntitlement": { + "methods": [ + "get_entitlement" + ] + }, + "CreateEntitlement": { + "methods": [ + "create_entitlement" + ] + }, + "DeleteEntitlement": { + "methods": [ + "delete_entitlement" + ] + }, + "UpdateEntitlement": { + "methods": [ + "update_entitlement" + ] + }, + "ListGrants": { + "methods": [ + "list_grants" + ] + }, + "SearchGrants": { + "methods": [ + "search_grants" + ] + }, + "GetGrant": { + "methods": [ + "get_grant" + ] + }, + "CreateGrant": { + "methods": [ + "create_grant" + ] + }, + "ApproveGrant": { + "methods": [ + "approve_grant" + ] + }, + "DenyGrant": { + "methods": [ + "deny_grant" + ] + }, + "RevokeGrant": { + "methods": [ + "revoke_grant" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec b/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec new file mode 100644 index 000000000000..a5ec6da4e1fc --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/privileged_access_manager/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-privileged_access_manager-v1" + gem.version = Google::Cloud::PrivilegedAccessManager::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes. Note that google-cloud-privileged_access_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-privileged_access_manager instead. See the readme for more details." + gem.summary = "Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more." + 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-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb new file mode 100644 index 000000000000..f746aee733aa --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_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/privileged_access_manager/v1" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb new file mode 100644 index 000000000000..27ee76e5a833 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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/privileged_access_manager/v1/privileged_access_manager" +require "google/cloud/privileged_access_manager/v1/version" + +module Google + module Cloud + module PrivilegedAccessManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/privileged_access_manager/v1" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/privileged_access_manager/v1" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/privileged_access_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb new file mode 100644 index 000000000000..b09873e2bf4d --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 PrivilegedAccessManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/privileged_access_manager/v1/rest" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "PrivilegedAccessManager"] + parent_config = while namespace.any? + parent_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 + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/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 + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^organizations/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^folders/[^/]+/?$}, 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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb new file mode 100644 index 000000000000..54d056f430dd --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.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/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/privileged_access_manager/v1/version" + +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/paths" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/operations" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/client" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + ## + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/privileged_access_manager/v1/privileged_access_manager" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + module PrivilegedAccessManager + end + end + end + end +end + +helper_path = ::File.join __dir__, "privileged_access_manager", "helpers.rb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb new file mode 100644 index 000000000000..e85b2b64e016 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb @@ -0,0 +1,1940 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" +require "google/cloud/location" + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + ## + # Client for the PrivilegedAccessManager service. + # + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :privileged_access_manager_stub + + ## + # Configure the PrivilegedAccessManager Client class. + # + # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrivilegedAccessManager clients + # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "PrivilegedAccessManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrivilegedAccessManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @privileged_access_manager_stub.universe_domain + end + + ## + # Create a new PrivilegedAccessManager client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrivilegedAccessManager 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/privilegedaccessmanager/v1/privilegedaccessmanager_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 + + @privileged_access_manager_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + ) + + @privileged_access_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 = @privileged_access_manager_stub.endpoint + config.universe_domain = @privileged_access_manager_stub.universe_domain + config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + @privileged_access_manager_stub.logger + end + + # Service calls + + ## + # `CheckOnboardingStatus` reports the onboarding status for a + # project/folder/organization. Any findings reported by this API need to be + # fixed before PAM can be used on the resource. + # + # @overload check_onboarding_status(request, options = nil) + # Pass arguments to `check_onboarding_status` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload check_onboarding_status(parent: nil) + # Pass arguments to `check_onboarding_status` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource for which the onboarding status should be checked. + # Should be in one of the following formats: + # + # * `projects/{project-number|project-id}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `organizations/{organization-number}/locations/{region}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new + # + # # Call the check_onboarding_status method. + # result = client.check_onboarding_status request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. + # p result + # + def check_onboarding_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.check_onboarding_status.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.check_onboarding_status.timeout, + metadata: metadata, + retry_policy: @config.rpcs.check_onboarding_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :check_onboarding_status, request, 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 entitlements in a given project/folder/organization and location. + # + # @overload list_entitlements(request, options = nil) + # Pass arguments to `list_entitlements` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_entitlements` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the entitlement resources. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new + # + # # Call the list_entitlements method. + # result = client.list_entitlements request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p item + # end + # + def list_entitlements request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_entitlements.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_entitlements.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :list_entitlements, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_entitlements, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `SearchEntitlements` returns entitlements on which the caller has the + # specified access. + # + # @overload search_entitlements(request, options = nil) + # Pass arguments to `search_entitlements` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entitlements(parent: nil, caller_access_type: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_entitlements` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the entitlement resources. + # @param caller_access_type [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] + # Required. Only entitlements where the calling user has this access are + # returned. + # @param filter [::String] + # Optional. Only entitlements matching this filter are returned in the + # response. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks 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::PrivilegedAccessManager::V1::Entitlement>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new + # + # # Call the search_entitlements method. + # result = client.search_entitlements request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p item + # end + # + def search_entitlements request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest + + # Converts hash and nil to 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_entitlements.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_entitlements.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_entitlements.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :search_entitlements, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, request, response, 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 entitlement. + # + # @overload get_entitlement(request, options = nil) + # Pass arguments to `get_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_entitlement(name: nil) + # Pass arguments to `get_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Entitlement] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new + # + # # Call the get_entitlement method. + # result = client.get_entitlement request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p result + # + def get_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :get_entitlement, request, 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 entitlement in a given project/folder/organization and + # location. + # + # @overload create_entitlement(request, options = nil) + # Pass arguments to `create_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_entitlement(parent: nil, entitlement_id: nil, entitlement: nil, request_id: nil) + # Pass arguments to `create_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent resource for the entitlement. + # Possible formats: + # + # * `organizations/{organization-number}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `projects/{project-id|project-number}/locations/{region}` + # @param entitlement_id [::String] + # Required. The ID to use for this entitlement. This becomes the last part of + # the resource name. + # + # This value should be 4-63 characters in length, and valid characters are + # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + # + # This value should be unique among all other entitlements under the + # specified `parent`. + # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request and returns the + # previous operation's response. This prevents clients from accidentally + # creating duplicate entitlements. + # + # 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/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new + # + # # Call the create_entitlement method. + # result = client.create_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest + + # Converts hash and nil to 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_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_entitlement.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :create_entitlement, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 entitlement. This method can only be called when there + # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the + # entitlement. + # + # @overload delete_entitlement(request, options = nil) + # Pass arguments to `delete_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_entitlement(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any child grant under this entitlement is also + # deleted. (Otherwise, the request only works if the entitlement has no child + # grant.) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new + # + # # Call the delete_entitlement method. + # result = client.delete_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_entitlement.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :delete_entitlement, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 entitlement specified in the request. Updated fields in the + # entitlement need to be specified in an update mask. The changes made to an + # entitlement are applicable only on future grants of the entitlement. + # However, if new approvers are added or existing approvers are removed from + # the approval workflow, the changes are effective on existing grants. + # + # The following fields are not supported for updates: + # + # * All immutable fields + # * Entitlement name + # * Resource name + # * Resource type + # * Adding an approval workflow in an entitlement which previously had no + # approval workflow. + # * Deleting the approval workflow from an entitlement. + # * Adding or deleting a step in the approval workflow (only one step is + # supported) + # + # Note that updates are allowed on the list of approvers in an approval + # workflow step. + # + # @overload update_entitlement(request, options = nil) + # Pass arguments to `update_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_entitlement(entitlement: nil, update_mask: nil) + # Pass arguments to `update_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::Hash] + # Required. The entitlement resource that is updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. A field is overwritten if, and only + # if, it is in the mask. Any immutable fields set in the mask are ignored by + # the server. Repeated fields and map fields are only allowed in the last + # position of a `paths` string and overwrite the existing values. Hence an + # update to a repeated field or a map should contain the entire list of + # values. The fields specified in the update_mask are relative to the + # resource and not to the request. + # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + # A value of '*' for this field refers to full replacement of the 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/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new + # + # # Call the update_entitlement method. + # result = client.update_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest + + # Converts hash and nil to 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_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.entitlement&.name + header_params["entitlement.name"] = request.entitlement.name + end + + request_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_entitlement.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :update_entitlement, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 grants for a given entitlement. + # + # @overload list_grants(request, options = nil) + # Pass arguments to `list_grants` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_grants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_grants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource which owns the grants. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new + # + # # Call the list_grants method. + # result = client.list_grants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p item + # end + # + def list_grants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_grants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_grants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_grants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :list_grants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_grants, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `SearchGrants` returns grants that are related to the calling user in the + # specified way. + # + # @overload search_grants(request, options = nil) + # Pass arguments to `search_grants` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_grants(parent: nil, caller_relationship: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_grants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the grant resources. + # @param caller_relationship [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] + # Required. Only grants which the caller is related to by this relationship + # are returned in the response. + # @param filter [::String] + # Optional. Only grants matching this filter are returned in the response. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, server picks 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::PrivilegedAccessManager::V1::Grant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new + # + # # Call the search_grants method. + # result = client.search_grants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p item + # end + # + def search_grants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest + + # Converts hash and nil to 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_grants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_grants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_grants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :search_grants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get details of a single grant. + # + # @overload get_grant(request, options = nil) + # Pass arguments to `get_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_grant(name: nil) + # Pass arguments to `get_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new + # + # # Call the get_grant method. + # result = client.get_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def get_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_grant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :get_grant, request, 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 grant in a given project/folder/organization and + # location. + # + # @overload create_grant(request, options = nil) + # Pass arguments to `create_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_grant(parent: nil, grant: nil, request_id: nil) + # Pass arguments to `create_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent entitlement for which this grant is being + # requested. + # @param grant [::Google::Cloud::PrivilegedAccessManager::V1::Grant, ::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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. This prevents + # clients from accidentally creating duplicate grants. + # + # 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::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new + # + # # Call the create_grant method. + # result = client.create_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def create_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest + + # Converts hash and nil to 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_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_grant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :create_grant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `ApproveGrant` is used to approve a grant. This method can only be called + # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't + # be undone. + # + # @overload approve_grant(request, options = nil) + # Pass arguments to `approve_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload approve_grant(name: nil, reason: nil) + # Pass arguments to `approve_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being approved. + # @param reason [::String] + # Optional. The reason for approving this grant. This is required if the + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new + # + # # Call the approve_grant method. + # result = client.approve_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def approve_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.approve_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.approve_grant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.approve_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :approve_grant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `DenyGrant` is used to deny a grant. This method can only be called on a + # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be + # undone. + # + # @overload deny_grant(request, options = nil) + # Pass arguments to `deny_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deny_grant(name: nil, reason: nil) + # Pass arguments to `deny_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being denied. + # @param reason [::String] + # Optional. The reason for denying this grant. This is required if + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new + # + # # Call the deny_grant method. + # result = client.deny_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def deny_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.deny_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.deny_grant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deny_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :deny_grant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `RevokeGrant` is used to immediately revoke access for a grant. This method + # can be called when the grant is in a non-terminal state. + # + # @overload revoke_grant(request, options = nil) + # Pass arguments to `revoke_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_grant(name: nil, reason: nil) + # Pass arguments to `revoke_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being revoked. + # @param reason [::String] + # Optional. The reason for revoking this grant. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new + # + # # Call the revoke_grant method. + # result = client.revoke_grant request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def revoke_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest + + # Converts hash and nil to 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_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_grant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.revoke_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.call_rpc :revoke_grant, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 PrivilegedAccessManager API. + # + # This class represents the configuration for PrivilegedAccessManager, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # check_onboarding_status to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.check_onboarding_status.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.check_onboarding_status.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 = "privilegedaccessmanager.googleapis.com" + + config_attr :endpoint, nil, ::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 PrivilegedAccessManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `check_onboarding_status` + # @return [::Gapic::Config::Method] + # + attr_reader :check_onboarding_status + ## + # RPC-specific configuration for `list_entitlements` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entitlements + ## + # RPC-specific configuration for `search_entitlements` + # @return [::Gapic::Config::Method] + # + attr_reader :search_entitlements + ## + # RPC-specific configuration for `get_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entitlement + ## + # RPC-specific configuration for `create_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entitlement + ## + # RPC-specific configuration for `delete_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entitlement + ## + # RPC-specific configuration for `update_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entitlement + ## + # RPC-specific configuration for `list_grants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_grants + ## + # RPC-specific configuration for `search_grants` + # @return [::Gapic::Config::Method] + # + attr_reader :search_grants + ## + # RPC-specific configuration for `get_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_grant + ## + # RPC-specific configuration for `create_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_grant + ## + # RPC-specific configuration for `approve_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_grant + ## + # RPC-specific configuration for `deny_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :deny_grant + ## + # RPC-specific configuration for `revoke_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_grant + + # @private + def initialize parent_rpcs = nil + check_onboarding_status_config = parent_rpcs.check_onboarding_status if parent_rpcs.respond_to? :check_onboarding_status + @check_onboarding_status = ::Gapic::Config::Method.new check_onboarding_status_config + list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements + @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config + search_entitlements_config = parent_rpcs.search_entitlements if parent_rpcs.respond_to? :search_entitlements + @search_entitlements = ::Gapic::Config::Method.new search_entitlements_config + get_entitlement_config = parent_rpcs.get_entitlement if parent_rpcs.respond_to? :get_entitlement + @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config + create_entitlement_config = parent_rpcs.create_entitlement if parent_rpcs.respond_to? :create_entitlement + @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config + delete_entitlement_config = parent_rpcs.delete_entitlement if parent_rpcs.respond_to? :delete_entitlement + @delete_entitlement = ::Gapic::Config::Method.new delete_entitlement_config + update_entitlement_config = parent_rpcs.update_entitlement if parent_rpcs.respond_to? :update_entitlement + @update_entitlement = ::Gapic::Config::Method.new update_entitlement_config + list_grants_config = parent_rpcs.list_grants if parent_rpcs.respond_to? :list_grants + @list_grants = ::Gapic::Config::Method.new list_grants_config + search_grants_config = parent_rpcs.search_grants if parent_rpcs.respond_to? :search_grants + @search_grants = ::Gapic::Config::Method.new search_grants_config + get_grant_config = parent_rpcs.get_grant if parent_rpcs.respond_to? :get_grant + @get_grant = ::Gapic::Config::Method.new get_grant_config + create_grant_config = parent_rpcs.create_grant if parent_rpcs.respond_to? :create_grant + @create_grant = ::Gapic::Config::Method.new create_grant_config + approve_grant_config = parent_rpcs.approve_grant if parent_rpcs.respond_to? :approve_grant + @approve_grant = ::Gapic::Config::Method.new approve_grant_config + deny_grant_config = parent_rpcs.deny_grant if parent_rpcs.respond_to? :deny_grant + @deny_grant = ::Gapic::Config::Method.new deny_grant_config + revoke_grant_config = parent_rpcs.revoke_grant if parent_rpcs.respond_to? :revoke_grant + @revoke_grant = ::Gapic::Config::Method.new revoke_grant_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb new file mode 100644 index 000000000000..368e8ad07437 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_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 PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + # Credentials for the PrivilegedAccessManager 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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb new file mode 100644 index 000000000000..9ac844f19b02 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_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 PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PrivilegedAccessManager 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 PrivilegedAccessManager 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::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::PrivilegedAccessManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::PrivilegedAccessManager::V1::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 = "privilegedaccessmanager.googleapis.com" + + config_attr :endpoint, nil, ::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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb new file mode 100644 index 000000000000..db3cf0bd41c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb @@ -0,0 +1,206 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + # Path helper methods for the PrivilegedAccessManager API. + module Paths + ## + # Create a fully-qualified Entitlement resource string. + # + # @overload entitlement_path(project:, location:, entitlement:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/entitlements/{entitlement}` + # + # @param project [String] + # @param location [String] + # @param entitlement [String] + # + # @overload entitlement_path(folder:, location:, entitlement:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/entitlements/{entitlement}` + # + # @param folder [String] + # @param location [String] + # @param entitlement [String] + # + # @overload entitlement_path(organization:, location:, entitlement:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/entitlements/{entitlement}` + # + # @param organization [String] + # @param location [String] + # @param entitlement [String] + # + # @return [::String] + def entitlement_path **args + resources = { + "entitlement:location:project" => (proc do |project:, location:, entitlement:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/entitlements/#{entitlement}" + end), + "entitlement:folder:location" => (proc do |folder:, location:, entitlement:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/entitlements/#{entitlement}" + end), + "entitlement:location:organization" => (proc do |organization:, location:, entitlement:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/entitlements/#{entitlement}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified FolderLocation resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}` + # + # @param folder [String] + # @param location [String] + # + # @return [::String] + def folder_location_path folder:, location: + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/locations/#{location}" + end + + ## + # Create a fully-qualified Grant resource string. + # + # @overload grant_path(project:, location:, entitlement:, grant:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}` + # + # @param project [String] + # @param location [String] + # @param entitlement [String] + # @param grant [String] + # + # @overload grant_path(folder:, location:, entitlement:, grant:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}` + # + # @param folder [String] + # @param location [String] + # @param entitlement [String] + # @param grant [String] + # + # @overload grant_path(organization:, location:, entitlement:, grant:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}` + # + # @param organization [String] + # @param location [String] + # @param entitlement [String] + # @param grant [String] + # + # @return [::String] + def grant_path **args + resources = { + "entitlement:grant:location:project" => (proc do |project:, location:, entitlement:, grant:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" + + "projects/#{project}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" + end), + "entitlement:folder:grant:location" => (proc do |folder:, location:, entitlement:, grant:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" + end), + "entitlement:grant:location:organization" => (proc do |organization:, location:, entitlement:, grant:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" + 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 Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified OrganizationLocation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}` + # + # @param organization [String] + # @param location [String] + # + # @return [::String] + def organization_location_path organization:, location: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb new file mode 100644 index 000000000000..21d09415b196 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/privileged_access_manager/v1/version" +require "google/cloud/privileged_access_manager/v1/bindings_override" + +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/paths" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client" + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + ## + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + module PrivilegedAccessManager + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb new file mode 100644 index 000000000000..86d01e30524b --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb @@ -0,0 +1,1807 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + module Rest + ## + # REST client for the PrivilegedAccessManager service. + # + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :privileged_access_manager_stub + + ## + # Configure the PrivilegedAccessManager Client class. + # + # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrivilegedAccessManager clients + # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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", "PrivilegedAccessManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrivilegedAccessManager Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + @privileged_access_manager_stub.universe_domain + end + + ## + # Create a new PrivilegedAccessManager REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrivilegedAccessManager 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + + @privileged_access_manager_stub = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @privileged_access_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 = @privileged_access_manager_stub.endpoint + config.universe_domain = @privileged_access_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + @privileged_access_manager_stub.logger + end + + # Service calls + + ## + # `CheckOnboardingStatus` reports the onboarding status for a + # project/folder/organization. Any findings reported by this API need to be + # fixed before PAM can be used on the resource. + # + # @overload check_onboarding_status(request, options = nil) + # Pass arguments to `check_onboarding_status` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload check_onboarding_status(parent: nil) + # Pass arguments to `check_onboarding_status` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource for which the onboarding status should be checked. + # Should be in one of the following formats: + # + # * `projects/{project-number|project-id}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `organizations/{organization-number}/locations/{region}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new + # + # # Call the check_onboarding_status method. + # result = client.check_onboarding_status request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. + # p result + # + def check_onboarding_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.check_onboarding_status.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.check_onboarding_status.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.check_onboarding_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.check_onboarding_status request, 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 entitlements in a given project/folder/organization and location. + # + # @overload list_entitlements(request, options = nil) + # Pass arguments to `list_entitlements` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_entitlements` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the entitlement resources. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. 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::PrivilegedAccessManager::V1::Entitlement>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new + # + # # Call the list_entitlements method. + # result = client.list_entitlements request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p item + # end + # + def list_entitlements request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_entitlements.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_entitlements.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.list_entitlements request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :list_entitlements, "entitlements", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `SearchEntitlements` returns entitlements on which the caller has the + # specified access. + # + # @overload search_entitlements(request, options = nil) + # Pass arguments to `search_entitlements` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entitlements(parent: nil, caller_access_type: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_entitlements` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the entitlement resources. + # @param caller_access_type [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] + # Required. Only entitlements where the calling user has this access are + # returned. + # @param filter [::String] + # Optional. Only entitlements matching this filter are returned in the + # response. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks 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::PrivilegedAccessManager::V1::Entitlement>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new + # + # # Call the search_entitlements method. + # result = client.search_entitlements request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p item + # end + # + def search_entitlements request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest + + # Converts hash and nil to an 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_entitlements.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entitlements.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_entitlements.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.search_entitlements request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, "entitlements", request, result, 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 entitlement. + # + # @overload get_entitlement(request, options = nil) + # Pass arguments to `get_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_entitlement(name: nil) + # Pass arguments to `get_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Entitlement] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new + # + # # Call the get_entitlement method. + # result = client.get_entitlement request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + # p result + # + def get_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.get_entitlement request, 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 entitlement in a given project/folder/organization and + # location. + # + # @overload create_entitlement(request, options = nil) + # Pass arguments to `create_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_entitlement(parent: nil, entitlement_id: nil, entitlement: nil, request_id: nil) + # Pass arguments to `create_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent resource for the entitlement. + # Possible formats: + # + # * `organizations/{organization-number}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `projects/{project-id|project-number}/locations/{region}` + # @param entitlement_id [::String] + # Required. The ID to use for this entitlement. This becomes the last part of + # the resource name. + # + # This value should be 4-63 characters in length, and valid characters are + # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + # + # This value should be unique among all other entitlements under the + # specified `parent`. + # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request and returns the + # previous operation's response. This prevents clients from accidentally + # creating duplicate entitlements. + # + # 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/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new + # + # # Call the create_entitlement method. + # result = client.create_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest + + # Converts hash and nil to an 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_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.create_entitlement request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 entitlement. This method can only be called when there + # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the + # entitlement. + # + # @overload delete_entitlement(request, options = nil) + # Pass arguments to `delete_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_entitlement(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any child grant under this entitlement is also + # deleted. (Otherwise, the request only works if the entitlement has no child + # grant.) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new + # + # # Call the delete_entitlement method. + # result = client.delete_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest + + # Converts hash and nil to an 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_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.delete_entitlement request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 entitlement specified in the request. Updated fields in the + # entitlement need to be specified in an update mask. The changes made to an + # entitlement are applicable only on future grants of the entitlement. + # However, if new approvers are added or existing approvers are removed from + # the approval workflow, the changes are effective on existing grants. + # + # The following fields are not supported for updates: + # + # * All immutable fields + # * Entitlement name + # * Resource name + # * Resource type + # * Adding an approval workflow in an entitlement which previously had no + # approval workflow. + # * Deleting the approval workflow from an entitlement. + # * Adding or deleting a step in the approval workflow (only one step is + # supported) + # + # Note that updates are allowed on the list of approvers in an approval + # workflow step. + # + # @overload update_entitlement(request, options = nil) + # Pass arguments to `update_entitlement` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_entitlement(entitlement: nil, update_mask: nil) + # Pass arguments to `update_entitlement` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::Hash] + # Required. The entitlement resource that is updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. A field is overwritten if, and only + # if, it is in the mask. Any immutable fields set in the mask are ignored by + # the server. Repeated fields and map fields are only allowed in the last + # position of a `paths` string and overwrite the existing values. Hence an + # update to a repeated field or a map should contain the entire list of + # values. The fields specified in the update_mask are relative to the + # resource and not to the request. + # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + # A value of '*' for this field refers to full replacement of the 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/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new + # + # # Call the update_entitlement method. + # result = client.update_entitlement request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_entitlement request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest + + # Converts hash and nil to an 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_entitlement.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_entitlement.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.update_entitlement request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 grants for a given entitlement. + # + # @overload list_grants(request, options = nil) + # Pass arguments to `list_grants` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_grants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_grants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource which owns the grants. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results. + # @param order_by [::String] + # Optional. 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::PrivilegedAccessManager::V1::Grant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new + # + # # Call the list_grants method. + # result = client.list_grants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p item + # end + # + def list_grants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_grants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_grants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_grants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.list_grants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :list_grants, "grants", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `SearchGrants` returns grants that are related to the calling user in the + # specified way. + # + # @overload search_grants(request, options = nil) + # Pass arguments to `search_grants` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_grants(parent: nil, caller_relationship: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_grants` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent which owns the grant resources. + # @param caller_relationship [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] + # Required. Only grants which the caller is related to by this relationship + # are returned in the response. + # @param filter [::String] + # Optional. Only grants matching this filter are returned in the response. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, server picks 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::PrivilegedAccessManager::V1::Grant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new + # + # # Call the search_grants method. + # result = client.search_grants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p item + # end + # + def search_grants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest + + # Converts hash and nil to an 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_grants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_grants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_grants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.search_grants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, "grants", request, result, 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 details of a single grant. + # + # @overload get_grant(request, options = nil) + # Pass arguments to `get_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_grant(name: nil) + # Pass arguments to `get_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new + # + # # Call the get_grant method. + # result = client.get_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def get_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_grant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.get_grant request, 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 grant in a given project/folder/organization and + # location. + # + # @overload create_grant(request, options = nil) + # Pass arguments to `create_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_grant(parent: nil, grant: nil, request_id: nil) + # Pass arguments to `create_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent entitlement for which this grant is being + # requested. + # @param grant [::Google::Cloud::PrivilegedAccessManager::V1::Grant, ::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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. This prevents + # clients from accidentally creating duplicate grants. + # + # 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::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new + # + # # Call the create_grant method. + # result = client.create_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def create_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest + + # Converts hash and nil to an 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_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_grant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.create_grant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `ApproveGrant` is used to approve a grant. This method can only be called + # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't + # be undone. + # + # @overload approve_grant(request, options = nil) + # Pass arguments to `approve_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload approve_grant(name: nil, reason: nil) + # Pass arguments to `approve_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being approved. + # @param reason [::String] + # Optional. The reason for approving this grant. This is required if the + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new + # + # # Call the approve_grant method. + # result = client.approve_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def approve_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.approve_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.approve_grant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.approve_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.approve_grant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `DenyGrant` is used to deny a grant. This method can only be called on a + # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be + # undone. + # + # @overload deny_grant(request, options = nil) + # Pass arguments to `deny_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload deny_grant(name: nil, reason: nil) + # Pass arguments to `deny_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being denied. + # @param reason [::String] + # Optional. The reason for denying this grant. This is required if + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new + # + # # Call the deny_grant method. + # result = client.deny_grant request + # + # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + # p result + # + def deny_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.deny_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.deny_grant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deny_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.deny_grant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `RevokeGrant` is used to immediately revoke access for a grant. This method + # can be called when the grant is in a non-terminal state. + # + # @overload revoke_grant(request, options = nil) + # Pass arguments to `revoke_grant` via a request object, either of type + # {::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_grant(name: nil, reason: nil) + # Pass arguments to `revoke_grant` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 grant resource which is being revoked. + # @param reason [::String] + # Optional. The reason for revoking this grant. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/privileged_access_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new + # + # # Call the revoke_grant method. + # result = client.revoke_grant request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def revoke_grant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest + + # Converts hash and nil to an 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_grant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_grant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.revoke_grant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @privileged_access_manager_stub.revoke_grant request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 PrivilegedAccessManager REST API. + # + # This class represents the configuration for PrivilegedAccessManager 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 + # # check_onboarding_status to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.check_onboarding_status.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.check_onboarding_status.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "privilegedaccessmanager.googleapis.com" + + config_attr :endpoint, nil, ::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 PrivilegedAccessManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `check_onboarding_status` + # @return [::Gapic::Config::Method] + # + attr_reader :check_onboarding_status + ## + # RPC-specific configuration for `list_entitlements` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entitlements + ## + # RPC-specific configuration for `search_entitlements` + # @return [::Gapic::Config::Method] + # + attr_reader :search_entitlements + ## + # RPC-specific configuration for `get_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entitlement + ## + # RPC-specific configuration for `create_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entitlement + ## + # RPC-specific configuration for `delete_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entitlement + ## + # RPC-specific configuration for `update_entitlement` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entitlement + ## + # RPC-specific configuration for `list_grants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_grants + ## + # RPC-specific configuration for `search_grants` + # @return [::Gapic::Config::Method] + # + attr_reader :search_grants + ## + # RPC-specific configuration for `get_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_grant + ## + # RPC-specific configuration for `create_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_grant + ## + # RPC-specific configuration for `approve_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_grant + ## + # RPC-specific configuration for `deny_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :deny_grant + ## + # RPC-specific configuration for `revoke_grant` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_grant + + # @private + def initialize parent_rpcs = nil + check_onboarding_status_config = parent_rpcs.check_onboarding_status if parent_rpcs.respond_to? :check_onboarding_status + @check_onboarding_status = ::Gapic::Config::Method.new check_onboarding_status_config + list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements + @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config + search_entitlements_config = parent_rpcs.search_entitlements if parent_rpcs.respond_to? :search_entitlements + @search_entitlements = ::Gapic::Config::Method.new search_entitlements_config + get_entitlement_config = parent_rpcs.get_entitlement if parent_rpcs.respond_to? :get_entitlement + @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config + create_entitlement_config = parent_rpcs.create_entitlement if parent_rpcs.respond_to? :create_entitlement + @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config + delete_entitlement_config = parent_rpcs.delete_entitlement if parent_rpcs.respond_to? :delete_entitlement + @delete_entitlement = ::Gapic::Config::Method.new delete_entitlement_config + update_entitlement_config = parent_rpcs.update_entitlement if parent_rpcs.respond_to? :update_entitlement + @update_entitlement = ::Gapic::Config::Method.new update_entitlement_config + list_grants_config = parent_rpcs.list_grants if parent_rpcs.respond_to? :list_grants + @list_grants = ::Gapic::Config::Method.new list_grants_config + search_grants_config = parent_rpcs.search_grants if parent_rpcs.respond_to? :search_grants + @search_grants = ::Gapic::Config::Method.new search_grants_config + get_grant_config = parent_rpcs.get_grant if parent_rpcs.respond_to? :get_grant + @get_grant = ::Gapic::Config::Method.new get_grant_config + create_grant_config = parent_rpcs.create_grant if parent_rpcs.respond_to? :create_grant + @create_grant = ::Gapic::Config::Method.new create_grant_config + approve_grant_config = parent_rpcs.approve_grant if parent_rpcs.respond_to? :approve_grant + @approve_grant = ::Gapic::Config::Method.new approve_grant_config + deny_grant_config = parent_rpcs.deny_grant if parent_rpcs.respond_to? :deny_grant + @deny_grant = ::Gapic::Config::Method.new deny_grant_config + revoke_grant_config = parent_rpcs.revoke_grant if parent_rpcs.respond_to? :revoke_grant + @revoke_grant = ::Gapic::Config::Method.new revoke_grant_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb new file mode 100644 index 000000000000..89aebd7b524e --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb @@ -0,0 +1,967 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PrivilegedAccessManager 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 PrivilegedAccessManager 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::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::PrivilegedAccessManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "privilegedaccessmanager.googleapis.com" + + config_attr :endpoint, nil, ::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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^folders/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/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{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb new file mode 100644 index 000000000000..4bc26c522b26 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb @@ -0,0 +1,1149 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + module Rest + ## + # REST service stub for the PrivilegedAccessManager 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 check_onboarding_status REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] + # A result object deserialized from the server's reply + def check_onboarding_status request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_check_onboarding_status_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "check_onboarding_status", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.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_entitlements REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse] + # A result object deserialized from the server's reply + def list_entitlements request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_entitlements_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_entitlements", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.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_entitlements REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse] + # A result object deserialized from the server's reply + def search_entitlements request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_entitlements_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entitlements", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # A result object deserialized from the server's reply + def get_entitlement request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_entitlement_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_entitlement", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.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_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_entitlement request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_entitlement_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entitlement", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_entitlement request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_entitlement_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entitlement", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_entitlement request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_entitlement_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entitlement", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_grants REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse] + # A result object deserialized from the server's reply + def list_grants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_grants_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_grants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.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_grants REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse] + # A result object deserialized from the server's reply + def search_grants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_grants_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_grants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # A result object deserialized from the server's reply + def get_grant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_grant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_grant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.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_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # A result object deserialized from the server's reply + def create_grant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_grant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_grant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the approve_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # A result object deserialized from the server's reply + def approve_grant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_approve_grant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "approve_grant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the deny_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # A result object deserialized from the server's reply + def deny_grant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deny_grant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "deny_grant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.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_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def revoke_grant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_revoke_grant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_grant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 check_onboarding_status REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_check_onboarding_status_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:checkOnboardingStatus", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:checkOnboardingStatus", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:checkOnboardingStatus", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_entitlements REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_entitlements_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_entitlements REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest] + # 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_entitlements_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements:search", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements:search", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entitlements:search", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_entitlement_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest] + # 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_entitlement_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entitlements", + body: "entitlement", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entitlements", + body: "entitlement", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entitlements", + body: "entitlement", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest] + # 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_entitlement_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entitlement REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest] + # 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_entitlement_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entitlement.name}", + body: "entitlement", + matches: [ + ["entitlement.name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entitlement.name}", + body: "entitlement", + matches: [ + ["entitlement.name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entitlement.name}", + body: "entitlement", + matches: [ + ["entitlement.name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_grants REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_grants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_grants REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest] + # 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_grants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants:search", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants:search", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/grants:search", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_grant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest] + # 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_grant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/grants", + body: "grant", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/grants", + body: "grant", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/grants", + body: "grant", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the approve_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_approve_grant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:approve", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:approve", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:approve", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deny_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deny_grant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:deny", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:deny", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:deny", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the revoke_grant REST call + # + # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest] + # 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_grant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb new file mode 100644 index 000000000000..0bf38c0312fb --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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/privileged_access_manager/v1/privileged_access_manager/rest" +require "google/cloud/privileged_access_manager/v1/bindings_override" +require "google/cloud/privileged_access_manager/v1/version" + +module Google + module Cloud + module PrivilegedAccessManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/privileged_access_manager/v1/rest" + # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb new file mode 100644 index 000000000000..967f84a73478 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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 PrivilegedAccessManager + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb new file mode 100644 index 000000000000..a05367d9f2af --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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/rpc/status_pb' + + +descriptor_data = "\nEgoogle/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto\x12\'google.cloud.privilegedaccessmanager.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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"j\n\x1c\x43heckOnboardingStatusRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\"\xe3\x02\n\x1d\x43heckOnboardingStatusResponse\x12\x17\n\x0fservice_account\x18\x01 \x01(\t\x12`\n\x08\x66indings\x18\x02 \x03(\x0b\x32N.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding\x1a\xc6\x01\n\x07\x46inding\x12{\n\x11iam_access_denied\x18\x01 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDeniedH\x00\x1a.\n\x0fIAMAccessDenied\x12\x1b\n\x13missing_permissions\x18\x01 \x03(\tB\x0e\n\x0c\x66inding_type\"\xfd\x0c\n\x0b\x45ntitlement\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12X\n\x0e\x65ligible_users\x18\x05 \x03(\x0b\x32;.google.cloud.privilegedaccessmanager.v1.AccessControlEntryB\x03\xe0\x41\x01\x12Y\n\x11\x61pproval_workflow\x18\x06 \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.ApprovalWorkflowB\x03\xe0\x41\x01\x12T\n\x11privileged_access\x18\x07 \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess\x12<\n\x14max_request_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12N\n\x05state\x18\t \x01(\x0e\x32:.google.cloud.privilegedaccessmanager.v1.Entitlement.StateB\x03\xe0\x41\x03\x12~\n\x1erequester_justification_config\x18\n \x01(\x0b\x32Q.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfigB\x03\xe0\x41\x02\x12\x80\x01\n\x1f\x61\x64\x64itional_notification_targets\x18\x0b \x01(\x0b\x32R.google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargetsB\x03\xe0\x41\x01\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\x1a\xc5\x02\n\x1cRequesterJustificationConfig\x12w\n\rnot_mandatory\x18\x01 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatoryH\x00\x12v\n\x0cunstructured\x18\x02 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.UnstructuredH\x00\x1a\x0e\n\x0cNotMandatory\x1a\x0e\n\x0cUnstructuredB\x14\n\x12justification_type\x1am\n\x1d\x41\x64\x64itionalNotificationTargets\x12#\n\x16\x61\x64min_email_recipients\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\'\n\x1arequester_email_recipients\x18\x02 \x03(\tB\x03\xe0\x41\x01\"d\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\r\n\tAVAILABLE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0b\n\x07\x44\x45LETED\x10\x04\x12\x0c\n\x08UPDATING\x10\x05:\xa7\x02\xea\x41\xa3\x02\n2privilegedaccessmanager.googleapis.com/Entitlement\x12\x42projects/{project}/locations/{location}/entitlements/{entitlement}\x12@folders/{folder}/locations/{location}/entitlements/{entitlement}\x12Lorganizations/{organization}/locations/{location}/entitlements/{entitlement}*\x0c\x65ntitlements2\x0b\x65ntitlement\"-\n\x12\x41\x63\x63\x65ssControlEntry\x12\x17\n\nprincipals\x18\x01 \x03(\tB\x03\xe0\x41\x01\"}\n\x10\x41pprovalWorkflow\x12T\n\x10manual_approvals\x18\x01 \x01(\x0b\x32\x38.google.cloud.privilegedaccessmanager.v1.ManualApprovalsH\x00\x42\x13\n\x11\x61pproval_workflow\"\xb6\x02\n\x0fManualApprovals\x12+\n\x1erequire_approver_justification\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12Q\n\x05steps\x18\x02 \x03(\x0b\x32=.google.cloud.privilegedaccessmanager.v1.ManualApprovals.StepB\x03\xe0\x41\x01\x1a\xa2\x01\n\x04Step\x12S\n\tapprovers\x18\x01 \x03(\x0b\x32;.google.cloud.privilegedaccessmanager.v1.AccessControlEntryB\x03\xe0\x41\x01\x12\x1d\n\x10\x61pprovals_needed\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12&\n\x19\x61pprover_email_recipients\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\xfc\x02\n\x10PrivilegedAccess\x12`\n\x0egcp_iam_access\x18\x01 \x01(\x0b\x32\x46.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccessH\x00\x1a\xf6\x01\n\x0cGcpIamAccess\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08resource\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12n\n\rrole_bindings\x18\x04 \x03(\x0b\x32R.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBindingB\x03\xe0\x41\x02\x1a\x43\n\x0bRoleBinding\x12\x11\n\x04role\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14\x63ondition_expression\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x61\x63\x63\x65ss_type\"\xc2\x01\n\x17ListEntitlementsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x18ListEntitlementsResponse\x12J\n\x0c\x65ntitlements\x18\x01 \x03(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x84\x03\n\x19SearchEntitlementsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12t\n\x12\x63\x61ller_access_type\x18\x02 \x01(\x0e\x32S.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessTypeB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\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\"_\n\x10\x43\x61llerAccessType\x12\"\n\x1e\x43\x41LLER_ACCESS_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fGRANT_REQUESTER\x10\x01\x12\x12\n\x0eGRANT_APPROVER\x10\x02\"\x81\x01\n\x1aSearchEntitlementsResponse\x12J\n\x0c\x65ntitlements\x18\x01 \x03(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x15GetEntitlementRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privilegedaccessmanager.googleapis.com/Entitlement\"\xec\x01\n\x18\x43reateEntitlementRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12\x1b\n\x0e\x65ntitlement_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0b\x65ntitlement\x18\x03 \x01(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.EntitlementB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x18\x44\x65leteEntitlementRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privilegedaccessmanager.googleapis.com/Entitlement\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xa0\x01\n\x18UpdateEntitlementRequest\x12N\n\x0b\x65ntitlement\x18\x01 \x01(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.EntitlementB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xd6\x17\n\x05Grant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x16\n\trequester\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12:\n\x12requested_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12R\n\rjustification\x18\x06 \x01(\x0b\x32\x36.google.cloud.privilegedaccessmanager.v1.JustificationB\x03\xe0\x41\x01\x12H\n\x05state\x18\x07 \x01(\x0e\x32\x34.google.cloud.privilegedaccessmanager.v1.Grant.StateB\x03\xe0\x41\x03\x12N\n\x08timeline\x18\x08 \x01(\x0b\x32\x37.google.cloud.privilegedaccessmanager.v1.Grant.TimelineB\x03\xe0\x41\x03\x12Y\n\x11privileged_access\x18\t \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.PrivilegedAccessB\x03\xe0\x41\x03\x12S\n\x0b\x61udit_trail\x18\n \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.Grant.AuditTrailB\x03\xe0\x41\x03\x12(\n\x1b\x61\x64\x64itional_email_recipients\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12 \n\x13\x65xternally_modified\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x1a\xea\x0c\n\x08Timeline\x12R\n\x06\x65vents\x18\x01 \x03(\x0b\x32=.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.EventB\x03\xe0\x41\x03\x1a\x89\x0c\n\x05\x45vent\x12\\\n\trequested\x18\x02 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.RequestedH\x00\x12Z\n\x08\x61pproved\x18\x03 \x01(\x0b\x32\x46.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ApprovedH\x00\x12V\n\x06\x64\x65nied\x18\x04 \x01(\x0b\x32\x44.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.DeniedH\x00\x12X\n\x07revoked\x18\x05 \x01(\x0b\x32\x45.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.RevokedH\x00\x12\\\n\tscheduled\x18\x06 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ScheduledH\x00\x12\\\n\tactivated\x18\x07 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivatedH\x00\x12k\n\x11\x61\x63tivation_failed\x18\x08 \x01(\x0b\x32N.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailedH\x00\x12X\n\x07\x65xpired\x18\n \x01(\x0b\x32\x45.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExpiredH\x00\x12T\n\x05\x65nded\x18\x0b \x01(\x0b\x32\x43.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.EndedH\x00\x12o\n\x13\x65xternally_modified\x18\x0c \x01(\x0b\x32P.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModifiedH\x00\x12\\\n\twithdrawn\x18\r \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.WithdrawnH\x00\x12\x33\n\nevent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\tRequested\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x33\n\x08\x41pproved\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x31\n\x06\x44\x65nied\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x07Revoked\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x0b\n\tWithdrawn\x1aO\n\tScheduled\x12\x42\n\x19scheduled_activation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x0b\n\tActivated\x1a:\n\x10\x41\x63tivationFailed\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\t\n\x07\x45xpired\x1a\x07\n\x05\x45nded\x1a\x14\n\x12\x45xternallyModifiedB\x07\n\x05\x65vent\x1a\x85\x01\n\nAuditTrail\x12:\n\x11\x61\x63\x63\x65ss_grant_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x61\x63\x63\x65ss_remove_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xd5\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41PPROVAL_AWAITED\x10\x01\x12\n\n\x06\x44\x45NIED\x10\x03\x12\r\n\tSCHEDULED\x10\x04\x12\x0e\n\nACTIVATING\x10\x05\x12\n\n\x06\x41\x43TIVE\x10\x06\x12\x15\n\x11\x41\x43TIVATION_FAILED\x10\x07\x12\x0b\n\x07\x45XPIRED\x10\x08\x12\x0c\n\x08REVOKING\x10\t\x12\x0b\n\x07REVOKED\x10\n\x12\t\n\x05\x45NDED\x10\x0b\x12\x0f\n\x0bWITHDRAWING\x10\x0c\x12\r\n\tWITHDRAWN\x10\r:\xc2\x02\xea\x41\xbe\x02\n,privilegedaccessmanager.googleapis.com/Grant\x12Qprojects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}\x12Ofolders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}\x12[organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}*\x06grants2\x05grant\"F\n\rJustification\x12$\n\x1aunstructured_justification\x18\x01 \x01(\tH\x00\x42\x0f\n\rjustification\"\xb6\x01\n\x11ListGrantsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\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\"\x82\x01\n\x12ListGrantsResponse\x12>\n\x06grants\x18\x01 \x03(\x0b\x32..google.cloud.privilegedaccessmanager.v1.Grant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x90\x03\n\x13SearchGrantsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\x12u\n\x13\x63\x61ller_relationship\x18\x02 \x01(\x0e\x32S.google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipTypeB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\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\"v\n\x16\x43\x61llerRelationshipType\x12(\n$CALLER_RELATIONSHIP_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHAD_CREATED\x10\x01\x12\x0f\n\x0b\x43\x41N_APPROVE\x10\x02\x12\x10\n\x0cHAD_APPROVED\x10\x03\"o\n\x14SearchGrantsResponse\x12>\n\x06grants\x18\x01 \x03(\x0b\x32..google.cloud.privilegedaccessmanager.v1.Grant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"U\n\x0fGetGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\"n\n\x13\x41pproveGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"k\n\x10\x44\x65nyGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"m\n\x12RevokeGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n\x12\x43reateGrantRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\x12\x42\n\x05grant\x18\x02 \x01(\x0b\x32..google.cloud.privilegedaccessmanager.v1.GrantB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \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\x32\xc1\'\n\x17PrivilegedAccessManager\x12\xe9\x02\n\x15\x43heckOnboardingStatus\x12\x45.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest\x1a\x46.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse\"\xc0\x01\x82\xd3\xe4\x93\x02\xb9\x01\x12\x39/v1/{parent=projects/*/locations/*}:checkOnboardingStatusZ@\x12>/v1/{parent=organizations/*/locations/*}:checkOnboardingStatusZ:\x12\x38/v1/{parent=folders/*/locations/*}:checkOnboardingStatus\x12\xc8\x02\n\x10ListEntitlements\x12@.google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest\x1a\x41.google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse\"\xae\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9e\x01\x12\x30/v1/{parent=projects/*/locations/*}/entitlementsZ7\x12\x35/v1/{parent=organizations/*/locations/*}/entitlementsZ1\x12//v1/{parent=folders/*/locations/*}/entitlements\x12\xda\x02\n\x12SearchEntitlements\x12\x42.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest\x1a\x43.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse\"\xba\x01\x82\xd3\xe4\x93\x02\xb3\x01\x12\x37/v1/{parent=projects/*/locations/*}/entitlements:searchZ>\x12.google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest\x1a\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01\x12\x30/v1/{name=projects/*/locations/*/entitlements/*}Z7\x12\x35/v1/{name=organizations/*/locations/*/entitlements/*}Z1\x12//v1/{name=folders/*/locations/*/entitlements/*}\x12\x8b\x03\n\x11\x43reateEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\x93\x02\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41!parent,entitlement,entitlement_id\x82\xd3\xe4\x93\x02\xc5\x01\"0/v1/{parent=projects/*/locations/*}/entitlements:\x0b\x65ntitlementZD\"5/v1/{parent=organizations/*/locations/*}/entitlements:\x0b\x65ntitlementZ>\"//v1/{parent=folders/*/locations/*}/entitlements:\x0b\x65ntitlement\x12\xc7\x02\n\x11\x44\x65leteEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\xcf\x01\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01*0/v1/{name=projects/*/locations/*/entitlements/*}Z7*5/v1/{name=organizations/*/locations/*/entitlements/*}Z1*//v1/{name=folders/*/locations/*/entitlements/*}\x12\xa5\x03\n\x11UpdateEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\xad\x02\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41\x17\x65ntitlement,update_mask\x82\xd3\xe4\x93\x02\xe9\x01\x32/v1/{parent=organizations/*/locations/*/entitlements/*}/grantsZ:\x12\x38/v1/{parent=folders/*/locations/*/entitlements/*}/grants\x12\xe3\x02\n\x0cSearchGrants\x12<.google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest\x1a=.google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse\"\xd5\x01\x82\xd3\xe4\x93\x02\xce\x01\x12@/v1/{parent=projects/*/locations/*/entitlements/*}/grants:searchZG\x12\x45/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:searchZA\x12?/v1/{parent=folders/*/locations/*/entitlements/*}/grants:search\x12\xbe\x02\n\x08GetGrant\x12\x38.google.cloud.privilegedaccessmanager.v1.GetGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xc7\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb9\x01\x12\x39/v1/{name=projects/*/locations/*/entitlements/*/grants/*}Z@\x12>/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}Z:\x12\x38/v1/{name=folders/*/locations/*/entitlements/*/grants/*}\x12\xe1\x02\n\x0b\x43reateGrant\x12;.google.cloud.privilegedaccessmanager.v1.CreateGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xe4\x01\xda\x41\x0cparent,grant\x82\xd3\xe4\x93\x02\xce\x01\"9/v1/{parent=projects/*/locations/*/entitlements/*}/grants:\x05grantZG\">/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:\x05grantZA\"8/v1/{parent=folders/*/locations/*/entitlements/*}/grants:\x05grant\x12\xe0\x02\n\x0c\x41pproveGrant\x12<.google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xe1\x01\x82\xd3\xe4\x93\x02\xda\x01\"A/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:approve:\x01*ZK\"F/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:approve:\x01*ZE\"@/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:approve:\x01*\x12\xd1\x02\n\tDenyGrant\x12\x39.google.cloud.privilegedaccessmanager.v1.DenyGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\">/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:deny:\x01*ZH\"C/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:deny:\x01*ZB\"=/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:deny:\x01*\x12\xe7\x02\n\x0bRevokeGrant\x12;.google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest\x1a\x1d.google.longrunning.Operation\"\xfb\x01\xca\x41\x1a\n\x05Grant\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\xd7\x01\"@/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:revoke:\x01*ZJ\"E/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:revoke:\x01*ZD\"?/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:revoke:\x01*\x1aZ\xca\x41&privilegedaccessmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x04\n+com.google.cloud.privilegedaccessmanager.v1B\x1cPrivilegedAccessManagerProtoP\x01Zecloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb;privilegedaccessmanagerpb\xaa\x02\'Google.Cloud.PrivilegedAccessManager.V1\xca\x02\'Google\\Cloud\\PrivilegedAccessManager\\V1\xea\x02*Google::Cloud::PrivilegedAccessManager::V1\xea\x41p\n;privilegedaccessmanager.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41^\n5privilegedaccessmanager.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["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 PrivilegedAccessManager + module V1 + CheckOnboardingStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest").msgclass + CheckOnboardingStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse").msgclass + CheckOnboardingStatusResponse::Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding").msgclass + CheckOnboardingStatusResponse::Finding::IAMAccessDenied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied").msgclass + Entitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement").msgclass + Entitlement::RequesterJustificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig").msgclass + Entitlement::RequesterJustificationConfig::NotMandatory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory").msgclass + Entitlement::RequesterJustificationConfig::Unstructured = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured").msgclass + Entitlement::AdditionalNotificationTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets").msgclass + Entitlement::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.State").enummodule + AccessControlEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.AccessControlEntry").msgclass + ApprovalWorkflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow").msgclass + ManualApprovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ManualApprovals").msgclass + ManualApprovals::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step").msgclass + PrivilegedAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess").msgclass + PrivilegedAccess::GcpIamAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess").msgclass + PrivilegedAccess::GcpIamAccess::RoleBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding").msgclass + ListEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest").msgclass + ListEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse").msgclass + SearchEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest").msgclass + SearchEntitlementsRequest::CallerAccessType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType").enummodule + SearchEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse").msgclass + GetEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest").msgclass + CreateEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest").msgclass + DeleteEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest").msgclass + UpdateEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest").msgclass + Grant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant").msgclass + Grant::Timeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline").msgclass + Grant::Timeline::Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event").msgclass + Grant::Timeline::Event::Requested = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested").msgclass + Grant::Timeline::Event::Approved = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved").msgclass + Grant::Timeline::Event::Denied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied").msgclass + Grant::Timeline::Event::Revoked = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked").msgclass + Grant::Timeline::Event::Withdrawn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Withdrawn").msgclass + Grant::Timeline::Event::Scheduled = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled").msgclass + Grant::Timeline::Event::Activated = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated").msgclass + Grant::Timeline::Event::ActivationFailed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed").msgclass + Grant::Timeline::Event::Expired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired").msgclass + Grant::Timeline::Event::Ended = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended").msgclass + Grant::Timeline::Event::ExternallyModified = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified").msgclass + Grant::AuditTrail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail").msgclass + Grant::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.State").enummodule + Justification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Justification").msgclass + ListGrantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListGrantsRequest").msgclass + ListGrantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListGrantsResponse").msgclass + SearchGrantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest").msgclass + SearchGrantsRequest::CallerRelationshipType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType").enummodule + SearchGrantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse").msgclass + GetGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.GetGrantRequest").msgclass + ApproveGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest").msgclass + DenyGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.DenyGrantRequest").msgclass + RevokeGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest").msgclass + CreateGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CreateGrantRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb new file mode 100644 index 000000000000..3665cee309bb --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb @@ -0,0 +1,122 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto for package 'Google.Cloud.PrivilegedAccessManager.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/privilegedaccessmanager/v1/privilegedaccessmanager_pb' + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + module PrivilegedAccessManager + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' + + # `CheckOnboardingStatus` reports the onboarding status for a + # project/folder/organization. Any findings reported by this API need to be + # fixed before PAM can be used on the resource. + rpc :CheckOnboardingStatus, ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse + # Lists entitlements in a given project/folder/organization and location. + rpc :ListEntitlements, ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse + # `SearchEntitlements` returns entitlements on which the caller has the + # specified access. + rpc :SearchEntitlements, ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse + # Gets details of a single entitlement. + rpc :GetEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement + # Creates a new entitlement in a given project/folder/organization and + # location. + rpc :CreateEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Google::Longrunning::Operation + # Deletes a single entitlement. This method can only be called when there + # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the + # entitlement. + rpc :DeleteEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Google::Longrunning::Operation + # Updates the entitlement specified in the request. Updated fields in the + # entitlement need to be specified in an update mask. The changes made to an + # entitlement are applicable only on future grants of the entitlement. + # However, if new approvers are added or existing approvers are removed from + # the approval workflow, the changes are effective on existing grants. + # + # The following fields are not supported for updates: + # + # * All immutable fields + # * Entitlement name + # * Resource name + # * Resource type + # * Adding an approval workflow in an entitlement which previously had no + # approval workflow. + # * Deleting the approval workflow from an entitlement. + # * Adding or deleting a step in the approval workflow (only one step is + # supported) + # + # Note that updates are allowed on the list of approvers in an approval + # workflow step. + rpc :UpdateEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Google::Longrunning::Operation + # Lists grants for a given entitlement. + rpc :ListGrants, ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse + # `SearchGrants` returns grants that are related to the calling user in the + # specified way. + rpc :SearchGrants, ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse + # Get details of a single grant. + rpc :GetGrant, ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant + # Creates a new grant in a given project/folder/organization and + # location. + rpc :CreateGrant, ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant + # `ApproveGrant` is used to approve a grant. This method can only be called + # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't + # be undone. + rpc :ApproveGrant, ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant + # `DenyGrant` is used to deny a grant. This method can only be called on a + # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be + # undone. + rpc :DenyGrant, ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant + # `RevokeGrant` is used to immediately revoke access for a grant. This method + # can be called when the grant is in a non-terminal state. + rpc :RevokeGrant, ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md new file mode 100644 index 000000000000..0a202904453e --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Privileged Access 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-privileged_access_manager-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb new file mode 100644 index 000000000000..6cb539ee39ed --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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! + + +module Google + module Cloud + module PrivilegedAccessManager + module V1 + # Request message for `CheckOnboardingStatus` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource for which the onboarding status should be checked. + # Should be in one of the following formats: + # + # * `projects/{project-number|project-id}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `organizations/{organization-number}/locations/{region}` + class CheckOnboardingStatusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `CheckOnboardingStatus` method. + # @!attribute [rw] service_account + # @return [::String] + # The service account that PAM uses to act on this resource. + # @!attribute [rw] findings + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse::Finding>] + # List of issues that are preventing PAM from functioning for this resource + # and need to be fixed to complete onboarding. Some issues might not be + # detected or reported. + class CheckOnboardingStatusResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Finding represents an issue which prevents PAM from functioning properly + # for this resource. + # @!attribute [rw] iam_access_denied + # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse::Finding::IAMAccessDenied] + # PAM's service account is being denied access by Cloud IAM. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # PAM's service account is being denied access by Cloud IAM. + # This can be fixed by granting a role that contains the missing + # permissions to the service account or exempting it from deny policies if + # they are blocking the access. + # @!attribute [rw] missing_permissions + # @return [::Array<::String>] + # List of permissions that are being denied. + class IAMAccessDenied + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # An entitlement defines the eligibility of a set of users to obtain + # predefined access for some time possibly after going through an approval + # workflow. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the entitlement. + # Possible formats: + # + # * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` + # * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` + # * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp. + # @!attribute [rw] eligible_users + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::AccessControlEntry>] + # Optional. Who can create grants using this entitlement. This list should + # contain at most one entry. + # @!attribute [rw] approval_workflow + # @return [::Google::Cloud::PrivilegedAccessManager::V1::ApprovalWorkflow] + # Optional. The approvals needed before access are granted to a requester. No + # approvals are needed if this field is null. + # @!attribute [rw] privileged_access + # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess] + # The access granted to a requester on successful approval. + # @!attribute [rw] max_request_duration + # @return [::Google::Protobuf::Duration] + # Required. The maximum amount of time that access is granted for a request. + # A requester can ask for a duration less than this, but never more. + # @!attribute [r] state + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::State] + # Output only. Current state of this entitlement. + # @!attribute [rw] requester_justification_config + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig] + # Required. The manner in which the requester should provide a justification + # for requesting access. + # @!attribute [rw] additional_notification_targets + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::AdditionalNotificationTargets] + # Optional. Additional email addresses to be notified based on actions taken. + # @!attribute [rw] etag + # @return [::String] + # An `etag` is used for optimistic concurrency control as a way to prevent + # simultaneous updates to the same entitlement. An `etag` is returned in the + # response to `GetEntitlement` and the caller should put the `etag` in the + # request to `UpdateEntitlement` so that their change is applied on + # the same version. If this field is omitted or if there is a mismatch while + # updating an entitlement, then the server rejects the request. + class Entitlement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines how a requester must provide a justification when requesting + # access. + # @!attribute [rw] not_mandatory + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig::NotMandatory] + # This option means the requester isn't required to provide a + # justification. + # + # Note: The following fields are mutually exclusive: `not_mandatory`, `unstructured`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] unstructured + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig::Unstructured] + # This option means the requester must provide a string as + # justification. If this is selected, the server allows the requester + # to provide a justification but doesn't validate it. + # + # Note: The following fields are mutually exclusive: `unstructured`, `not_mandatory`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RequesterJustificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The justification is not mandatory but can be provided in any of the + # supported formats. + class NotMandatory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The requester has to provide a justification in the form of a string. + class Unstructured + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `AdditionalNotificationTargets` includes email addresses to be notified. + # @!attribute [rw] admin_email_recipients + # @return [::Array<::String>] + # Optional. Additional email addresses to be notified when a principal + # (requester) is granted access. + # @!attribute [rw] requester_email_recipients + # @return [::Array<::String>] + # Optional. Additional email address to be notified about an eligible + # entitlement. + class AdditionalNotificationTargets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Different states an entitlement can be in. + module State + # Unspecified state. This value is never returned by the server. + STATE_UNSPECIFIED = 0 + + # The entitlement is being created. + CREATING = 1 + + # The entitlement is available for requesting access. + AVAILABLE = 2 + + # The entitlement is being deleted. + DELETING = 3 + + # The entitlement has been deleted. + DELETED = 4 + + # The entitlement is being updated. + UPDATING = 5 + end + end + + # `AccessControlEntry` is used to control who can do some operation. + # @!attribute [rw] principals + # @return [::Array<::String>] + # Optional. Users who are allowed for the operation. Each entry should be a + # valid v1 IAM principal identifier. The format for these is documented at: + # https://cloud.google.com/iam/docs/principal-identifiers#v1 + class AccessControlEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Different types of approval workflows that can be used to gate privileged + # access granting. + # @!attribute [rw] manual_approvals + # @return [::Google::Cloud::PrivilegedAccessManager::V1::ManualApprovals] + # An approval workflow where users designated as approvers review and act + # on the grants. + class ApprovalWorkflow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A manual approval workflow where users who are designated as approvers + # need to call the `ApproveGrant`/`DenyGrant` APIs for a grant. The workflow + # can consist of multiple serial steps where each step defines who can act as + # approver in that step and how many of those users should approve before the + # workflow moves to the next step. + # + # This can be used to create approval workflows such as: + # + # * Require an approval from any user in a group G. + # * Require an approval from any k number of users from a Group G. + # * Require an approval from any user in a group G and then from a user U. + # + # A single user might be part of the `approvers` ACL for multiple steps in this + # workflow, but they can only approve once and that approval is only considered + # to satisfy the approval step at which it was granted. + # @!attribute [rw] require_approver_justification + # @return [::Boolean] + # Optional. Do the approvers need to provide a justification for their + # actions? + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::ManualApprovals::Step>] + # Optional. List of approval steps in this workflow. These steps are followed + # in the specified order sequentially. Only 1 step is supported. + class ManualApprovals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Step represents a logical step in a manual approval workflow. + # @!attribute [rw] approvers + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::AccessControlEntry>] + # Optional. The potential set of approvers in this step. This list must + # contain at most one entry. + # @!attribute [rw] approvals_needed + # @return [::Integer] + # Required. How many users from the above list need to approve. If there + # aren't enough distinct users in the list, then the workflow indefinitely + # blocks. Should always be greater than 0. 1 is the only supported value. + # @!attribute [rw] approver_email_recipients + # @return [::Array<::String>] + # Optional. Additional email addresses to be notified when a grant is + # pending approval. + class Step + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Privileged access that this service can be used to gate. + # @!attribute [rw] gcp_iam_access + # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess::GcpIamAccess] + # Access to a Google Cloud resource through IAM. + class PrivilegedAccess + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `GcpIamAccess` represents IAM based access control on a Google Cloud + # resource. Refer to https://cloud.google.com/iam/docs to understand more + # about IAM. + # @!attribute [rw] resource_type + # @return [::String] + # Required. The type of this resource. + # @!attribute [rw] resource + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] role_bindings + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess::GcpIamAccess::RoleBinding>] + # Required. Role bindings that are created on successful grant. + class GcpIamAccess + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # IAM role bindings that are created after a successful grant. + # @!attribute [rw] role + # @return [::String] + # Required. IAM role to be granted. + # https://cloud.google.com/iam/docs/roles-overview. + # @!attribute [rw] condition_expression + # @return [::String] + # Optional. The expression field of the IAM condition to be associated + # with the role. If specified, a user with an active grant for this + # entitlement is able to access the resource only if this condition + # evaluates to true for their request. + # + # This field uses the same CEL format as IAM and supports all attributes + # that IAM supports, except tags. + # https://cloud.google.com/iam/docs/conditions-overview#attributes. + class RoleBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Message for requesting list of entitlements. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent which owns the entitlement resources. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, the server picks 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. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results. + class ListEntitlementsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing entitlements. + # @!attribute [rw] entitlements + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # The list of entitlements. + # @!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 ListEntitlementsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `SearchEntitlements` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent which owns the entitlement resources. + # @!attribute [rw] caller_access_type + # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] + # Required. Only entitlements where the calling user has this access are + # returned. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only entitlements matching this filter are returned in the + # response. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class SearchEntitlementsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Different types of access a user can have on the entitlement resource. + module CallerAccessType + # Unspecified access type. + CALLER_ACCESS_TYPE_UNSPECIFIED = 0 + + # The user has access to create grants using this entitlement. + GRANT_REQUESTER = 1 + + # The user has access to approve/deny grants created under this + # entitlement. + GRANT_APPROVER = 2 + end + end + + # Response message for `SearchEntitlements` method. + # @!attribute [rw] entitlements + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] + # The list of entitlements. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class SearchEntitlementsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting an entitlement. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetEntitlementRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating an entitlement. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent resource for the entitlement. + # Possible formats: + # + # * `organizations/{organization-number}/locations/{region}` + # * `folders/{folder-number}/locations/{region}` + # * `projects/{project-id|project-number}/locations/{region}` + # @!attribute [rw] entitlement_id + # @return [::String] + # Required. The ID to use for this entitlement. This becomes the last part of + # the resource name. + # + # This value should be 4-63 characters in length, and valid characters are + # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. + # + # This value should be unique among all other entitlements under the + # specified `parent`. + # @!attribute [rw] entitlement + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # 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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request and returns the + # previous operation's response. This prevents clients from accidentally + # creating duplicate entitlements. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateEntitlementRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting an entitlement. + # @!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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, any child grant under this entitlement is also + # deleted. (Otherwise, the request only works if the entitlement has no child + # grant.) + class DeleteEntitlementRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating an entitlement. + # @!attribute [rw] entitlement + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] + # Required. The entitlement resource that is updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. A field is overwritten if, and only + # if, it is in the mask. Any immutable fields set in the mask are ignored by + # the server. Repeated fields and map fields are only allowed in the last + # position of a `paths` string and overwrite the existing values. Hence an + # update to a repeated field or a map should contain the entire list of + # values. The fields specified in the update_mask are relative to the + # resource and not to the request. + # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) + # A value of '*' for this field refers to full replacement of the resource. + class UpdateEntitlementRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A grant represents a request from a user for obtaining the access specified + # in an entitlement they are eligible for. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of this grant. + # Possible formats: + # + # * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + # * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + # * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` + # + # The last segment of this name (`{grant-id}`) is autogenerated. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp. + # @!attribute [r] requester + # @return [::String] + # Output only. Username of the user who created this grant. + # @!attribute [rw] requested_duration + # @return [::Google::Protobuf::Duration] + # Required. The amount of time access is needed for. This value should be + # less than the `max_request_duration` value of the entitlement. + # @!attribute [rw] justification + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Justification] + # Optional. Justification of why this access is needed. + # @!attribute [r] state + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::State] + # Output only. Current state of this grant. + # @!attribute [r] timeline + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline] + # Output only. Timeline of this grant. + # @!attribute [r] privileged_access + # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess] + # Output only. The access that would be granted by this grant. + # @!attribute [r] audit_trail + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::AuditTrail] + # Output only. Audit trail of access provided by this grant. If unspecified + # then access was never granted. + # @!attribute [rw] additional_email_recipients + # @return [::Array<::String>] + # Optional. Additional email addresses to notify for all the actions + # performed on the grant. + # @!attribute [r] externally_modified + # @return [::Boolean] + # Output only. Flag set by the PAM system to indicate that policy bindings + # made by this grant have been modified from outside PAM. + # + # After it is set, this flag remains set forever irrespective of the grant + # state. A `true` value here indicates that PAM no longer has any certainty + # on the access a user has because of this grant. + class Grant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Timeline of a grant describing what happened to it and when. + # @!attribute [r] events + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event>] + # Output only. The events that have occurred on this grant. This list + # contains entries in the same order as they occurred. The first entry is + # always be of type `Requested` and there is always at least one entry in + # this array. + class Timeline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single operation on the grant. + # @!attribute [rw] requested + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Requested] + # The grant was requested. + # + # Note: The following fields are mutually exclusive: `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] approved + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Approved] + # The grant was approved. + # + # Note: The following fields are mutually exclusive: `approved`, `requested`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] denied + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Denied] + # The grant was denied. + # + # Note: The following fields are mutually exclusive: `denied`, `requested`, `approved`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] revoked + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Revoked] + # The grant was revoked. + # + # Note: The following fields are mutually exclusive: `revoked`, `requested`, `approved`, `denied`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] scheduled + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Scheduled] + # The grant has been scheduled to give access. + # + # Note: The following fields are mutually exclusive: `scheduled`, `requested`, `approved`, `denied`, `revoked`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] activated + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Activated] + # The grant was successfully activated to give access. + # + # Note: The following fields are mutually exclusive: `activated`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] activation_failed + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::ActivationFailed] + # There was a non-retriable error while trying to give access. + # + # Note: The following fields are mutually exclusive: `activation_failed`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] expired + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Expired] + # The approval workflow did not complete in the necessary duration, + # and so the grant is expired. + # + # Note: The following fields are mutually exclusive: `expired`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ended + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Ended] + # Access given by the grant ended automatically as the approved + # duration was over. + # + # Note: The following fields are mutually exclusive: `ended`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] externally_modified + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::ExternallyModified] + # The policy bindings made by grant have been modified outside of PAM. + # + # Note: The following fields are mutually exclusive: `externally_modified`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] withdrawn + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Withdrawn] + # The grant was withdrawn. + # + # Note: The following fields are mutually exclusive: `withdrawn`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] event_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time (as recorded at server) when this event occurred. + class Event + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An event representing that a grant was requested. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this grant expires unless the approval + # workflow completes. If omitted, then the request never expires. + class Requested + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was approved. + # @!attribute [r] reason + # @return [::String] + # Output only. The reason provided by the approver for approving the + # grant. + # @!attribute [r] actor + # @return [::String] + # Output only. Username of the user who approved the grant. + class Approved + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was denied. + # @!attribute [r] reason + # @return [::String] + # Output only. The reason provided by the approver for denying the + # grant. + # @!attribute [r] actor + # @return [::String] + # Output only. Username of the user who denied the grant. + class Denied + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was revoked. + # @!attribute [r] reason + # @return [::String] + # Output only. The reason provided by the user for revoking the grant. + # @!attribute [r] actor + # @return [::String] + # Output only. Username of the user who revoked the grant. + class Revoked + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was withdrawn. + class Withdrawn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant has been scheduled to be + # activated later. + # @!attribute [r] scheduled_activation_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the access is granted. + class Scheduled + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was successfully + # activated. + class Activated + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant activation failed. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. The error that occurred while activating the grant. + class ActivationFailed + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant was expired. + class Expired + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the grant has ended. + class Ended + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event representing that the policy bindings made by this grant were + # modified externally. + class ExternallyModified + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Audit trail for the access provided by this grant. + # @!attribute [r] access_grant_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which access was given. + # @!attribute [r] access_remove_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the system removed access. This could be + # because of an automatic expiry or because of a revocation. + # + # If unspecified, then access hasn't been removed yet. + class AuditTrail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Different states a grant can be in. + module State + # Unspecified state. This value is never returned by the server. + STATE_UNSPECIFIED = 0 + + # The entitlement had an approval workflow configured and this grant is + # waiting for the workflow to complete. + APPROVAL_AWAITED = 1 + + # The approval workflow completed with a denied result. No access is + # granted for this grant. This is a terminal state. + DENIED = 3 + + # The approval workflow completed successfully with an approved result or + # none was configured. Access is provided at an appropriate time. + SCHEDULED = 4 + + # Access is being given. + ACTIVATING = 5 + + # Access was successfully given and is currently active. + ACTIVE = 6 + + # The system could not give access due to a non-retriable error. This is a + # terminal state. + ACTIVATION_FAILED = 7 + + # Expired after waiting for the approval workflow to complete. This is a + # terminal state. + EXPIRED = 8 + + # Access is being revoked. + REVOKING = 9 + + # Access was revoked by a user. This is a terminal state. + REVOKED = 10 + + # System took back access as the requested duration was over. This is a + # terminal state. + ENDED = 11 + + # Access is being withdrawn. + WITHDRAWING = 12 + + # Grant was withdrawn by the grant owner. This is a terminal state. + WITHDRAWN = 13 + end + end + + # Justification represents a justification for requesting access. + # @!attribute [rw] unstructured_justification + # @return [::String] + # A free form textual justification. The system only ensures that this + # is not empty. No other kind of validation is performed on the string. + class Justification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of grants. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource which owns the grants. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, the server picks 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. Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results + class ListGrantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing grants. + # @!attribute [rw] grants + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # The list of grants. + # @!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 ListGrantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `SearchGrants` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent which owns the grant resources. + # @!attribute [rw] caller_relationship + # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] + # Required. Only grants which the caller is related to by this relationship + # are returned in the response. + # @!attribute [rw] filter + # @return [::String] + # Optional. Only grants matching this filter are returned in the response. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer items than + # requested. If unspecified, server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class SearchGrantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Different types of relationships a user can have with a grant. + module CallerRelationshipType + # Unspecified caller relationship type. + CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0 + + # The user created this grant by calling `CreateGrant` earlier. + HAD_CREATED = 1 + + # The user is an approver for the entitlement that this grant is parented + # under and can currently approve/deny it. + CAN_APPROVE = 2 + + # The caller had successfully approved/denied this grant earlier. + HAD_APPROVED = 3 + end + end + + # Response message for `SearchGrants` method. + # @!attribute [rw] grants + # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] + # The list of grants. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class SearchGrantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a grant. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetGrantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `ApproveGrant` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the grant resource which is being approved. + # @!attribute [rw] reason + # @return [::String] + # Optional. The reason for approving this grant. This is required if the + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + class ApproveGrantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `DenyGrant` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the grant resource which is being denied. + # @!attribute [rw] reason + # @return [::String] + # Optional. The reason for denying this grant. This is required if + # `require_approver_justification` field of the `ManualApprovals` workflow + # used in this grant is true. + class DenyGrantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `RevokeGrant` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the grant resource which is being revoked. + # @!attribute [rw] reason + # @return [::String] + # Optional. The reason for revoking this grant. + class RevokeGrantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a grant + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent entitlement for which this grant is being + # requested. + # @!attribute [rw] grant + # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] + # 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 knows to + # ignore the request if it has already been completed. The server guarantees + # this 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, ignores the second request. This prevents + # clients from accidentally creating duplicate grants. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateGrantRequest + 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 been cancelled successfully + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/Gemfile new file mode 100644 index 000000000000..a8a6a830930c --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1", path: "../" +else + gem "google-cloud-privileged_access_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-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb new file mode 100644 index 000000000000..52b1b20616bd --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the approve_grant call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant. +# +def approve_grant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new + + # Call the approve_grant method. + result = client.approve_grant request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb new file mode 100644 index 000000000000..640c7c98fa01 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the check_onboarding_status call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status. +# +def check_onboarding_status + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new + + # Call the check_onboarding_status method. + result = client.check_onboarding_status request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb new file mode 100644 index 000000000000..563753d91a87 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the create_entitlement call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement. +# +def create_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new + + # Call the create_entitlement method. + result = client.create_entitlement request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb new file mode 100644 index 000000000000..9834cd29890b --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the create_grant call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant. +# +def create_grant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new + + # Call the create_grant method. + result = client.create_grant request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb new file mode 100644 index 000000000000..853407d3fe05 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the delete_entitlement call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement. +# +def delete_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new + + # Call the delete_entitlement method. + result = client.delete_entitlement request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb new file mode 100644 index 000000000000..2d0614604a9b --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the deny_grant call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant. +# +def deny_grant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new + + # Call the deny_grant method. + result = client.deny_grant request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb new file mode 100644 index 000000000000..f5d6232e72eb --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the get_entitlement call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement. +# +def get_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new + + # Call the get_entitlement method. + result = client.get_entitlement request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb new file mode 100644 index 000000000000..c7736a63daf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the get_grant call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant. +# +def get_grant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new + + # Call the get_grant method. + result = client.get_grant request + + # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. + p result +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb new file mode 100644 index 000000000000..c8f615dcb603 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the list_entitlements call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements. +# +def list_entitlements + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new + + # Call the list_entitlements method. + result = client.list_entitlements request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + p item + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb new file mode 100644 index 000000000000..ec4ab2e2bfe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the list_grants call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants. +# +def list_grants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new + + # Call the list_grants method. + result = client.list_grants request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + p item + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb new file mode 100644 index 000000000000..268612420952 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the revoke_grant call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant. +# +def revoke_grant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new + + # Call the revoke_grant method. + result = client.revoke_grant request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb new file mode 100644 index 000000000000..6ead02e2f736 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the search_entitlements call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements. +# +def search_entitlements + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new + + # Call the search_entitlements method. + result = client.search_entitlements request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. + p item + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb new file mode 100644 index 000000000000..4751360e4c54 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the search_grants call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants. +# +def search_grants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new + + # Call the search_grants method. + result = client.search_grants request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. + p item + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb new file mode 100644 index 000000000000..5008d00b64aa --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] +require "google/cloud/privileged_access_manager/v1" + +## +# Snippet for the update_entitlement call in the PrivilegedAccessManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement. +# +def update_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new + + # Call the update_entitlement method. + result = client.update_entitlement request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json new file mode 100644 index 000000000000..7b95f32dc0dd --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-privileged_access_manager-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.privilegedaccessmanager.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync", + "title": "Snippet for the check_onboarding_status call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status.", + "file": "privileged_access_manager/check_onboarding_status.rb", + "language": "RUBY", + "client_method": { + "short_name": "check_onboarding_status", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "CheckOnboardingStatus", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CheckOnboardingStatus", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync", + "title": "Snippet for the list_entitlements call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements.", + "file": "privileged_access_manager/list_entitlements.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_entitlements", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "ListEntitlements", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ListEntitlements", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync", + "title": "Snippet for the search_entitlements call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements.", + "file": "privileged_access_manager/search_entitlements.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_entitlements", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "SearchEntitlements", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.SearchEntitlements", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync", + "title": "Snippet for the get_entitlement call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement.", + "file": "privileged_access_manager/get_entitlement.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_entitlement", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Entitlement", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "GetEntitlement", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.GetEntitlement", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync", + "title": "Snippet for the create_entitlement call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement.", + "file": "privileged_access_manager/create_entitlement.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_entitlement", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "CreateEntitlement", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CreateEntitlement", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync", + "title": "Snippet for the delete_entitlement call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement.", + "file": "privileged_access_manager/delete_entitlement.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_entitlement", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "DeleteEntitlement", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.DeleteEntitlement", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync", + "title": "Snippet for the update_entitlement call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement.", + "file": "privileged_access_manager/update_entitlement.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_entitlement", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "UpdateEntitlement", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.UpdateEntitlement", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync", + "title": "Snippet for the list_grants call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants.", + "file": "privileged_access_manager/list_grants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_grants", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "ListGrants", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ListGrants", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync", + "title": "Snippet for the search_grants call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants.", + "file": "privileged_access_manager/search_grants.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_grants", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "SearchGrants", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.SearchGrants", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync", + "title": "Snippet for the get_grant call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant.", + "file": "privileged_access_manager/get_grant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_grant", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "GetGrant", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.GetGrant", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync", + "title": "Snippet for the create_grant call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant.", + "file": "privileged_access_manager/create_grant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_grant", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "CreateGrant", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CreateGrant", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync", + "title": "Snippet for the approve_grant call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant.", + "file": "privileged_access_manager/approve_grant.rb", + "language": "RUBY", + "client_method": { + "short_name": "approve_grant", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "ApproveGrant", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ApproveGrant", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync", + "title": "Snippet for the deny_grant call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant.", + "file": "privileged_access_manager/deny_grant.rb", + "language": "RUBY", + "client_method": { + "short_name": "deny_grant", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "DenyGrant", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.DenyGrant", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync", + "title": "Snippet for the revoke_grant call in the PrivilegedAccessManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant.", + "file": "privileged_access_manager/revoke_grant.rb", + "language": "RUBY", + "client_method": { + "short_name": "revoke_grant", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrivilegedAccessManager::Client", + "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" + }, + "method": { + "short_name": "RevokeGrant", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.RevokeGrant", + "service": { + "short_name": "PrivilegedAccessManager", + "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" + } + } + }, + "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-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb new file mode 100644 index 000000000000..9375f0cfd630 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_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/privilegedaccessmanager/v1/privilegedaccessmanager_pb" +require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager" + +class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb new file mode 100644 index 000000000000..461700b707ac --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_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/privileged_access_manager/v1/privileged_access_manager" + +class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_entitlement_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entitlement_path project: "value0", location: "value1", entitlement: "value2" + assert_equal "projects/value0/locations/value1/entitlements/value2", path + + path = client.entitlement_path folder: "value0", location: "value1", entitlement: "value2" + assert_equal "folders/value0/locations/value1/entitlements/value2", path + + path = client.entitlement_path organization: "value0", location: "value1", entitlement: "value2" + assert_equal "organizations/value0/locations/value1/entitlements/value2", path + end + end + + def test_folder_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_location_path folder: "value0", location: "value1" + assert_equal "folders/value0/locations/value1", path + end + end + + def test_grant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.grant_path project: "value0", location: "value1", entitlement: "value2", grant: "value3" + assert_equal "projects/value0/locations/value1/entitlements/value2/grants/value3", path + + path = client.grant_path folder: "value0", location: "value1", entitlement: "value2", grant: "value3" + assert_equal "folders/value0/locations/value1/entitlements/value2/grants/value3", path + + path = client.grant_path organization: "value0", location: "value1", entitlement: "value2", grant: "value3" + assert_equal "organizations/value0/locations/value1/entitlements/value2/grants/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_organization_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_location_path organization: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb new file mode 100644 index 000000000000..be14d76ac294 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb @@ -0,0 +1,882 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/privilegedaccessmanager/v1/privilegedaccessmanager_pb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" + + +class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_check_onboarding_status + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + check_onboarding_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_check_onboarding_status_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, check_onboarding_status_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.check_onboarding_status({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.check_onboarding_status parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.check_onboarding_status ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.check_onboarding_status({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.check_onboarding_status(::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, check_onboarding_status_client_stub.call_count + end + end + end + + def test_list_entitlements + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.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_entitlements_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_list_entitlements_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_entitlements_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_entitlements({ 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_entitlements 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_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements({ 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_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements_client_stub.call_count + end + end + end + + def test_search_entitlements + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + caller_access_type = :CALLER_ACCESS_TYPE_UNSPECIFIED + filter = "hello world" + page_size = 42 + page_token = "hello world" + + search_entitlements_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_search_entitlements_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_entitlements_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_entitlements parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_entitlements_client_stub.call_count + end + end + end + + def test_get_entitlement + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_get_entitlement_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_entitlement({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_entitlement name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_entitlement({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_entitlement_client_stub.call_count + end + end + end + + def test_create_entitlement + # Create test objects. + 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" + entitlement_id = "hello world" + entitlement = {} + request_id = "hello world" + + create_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_create_entitlement_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_entitlement parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_entitlement_client_stub.call_count + end + end + end + + def test_delete_entitlement + # Create test objects. + 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" + force = true + + delete_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_delete_entitlement_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_entitlement({ name: name, request_id: request_id, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_entitlement name: name, request_id: request_id, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_entitlement({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_entitlement_client_stub.call_count + end + end + end + + def test_update_entitlement + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + entitlement = {} + update_mask = {} + + update_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_update_entitlement_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_entitlement({ entitlement: entitlement, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_entitlement entitlement: entitlement, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_entitlement({ entitlement: entitlement, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_entitlement_client_stub.call_count + end + end + end + + def test_list_grants + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.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_grants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_list_grants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_grants_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_grants({ 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_grants 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_grants ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants({ 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_grants(::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants_client_stub.call_count + end + end + end + + def test_search_grants + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + caller_relationship = :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED + filter = "hello world" + page_size = 42 + page_token = "hello world" + + search_grants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_search_grants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_grants_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_grants parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_grants ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_grants(::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_grants_client_stub.call_count + end + end + end + + def test_get_grant + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_get_grant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_grant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_grant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_grant ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_grant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_grant(::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_grant_client_stub.call_count + end + end + end + + def test_create_grant + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + grant = {} + request_id = "hello world" + + create_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_create_grant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_grant({ parent: parent, grant: grant, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_grant parent: parent, grant: grant, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_grant ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_grant({ parent: parent, grant: grant, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_grant(::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_grant_client_stub.call_count + end + end + end + + def test_approve_grant + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = "hello world" + + approve_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_approve_grant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, approve_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.approve_grant({ name: name, reason: reason }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.approve_grant name: name, reason: reason do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.approve_grant ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.approve_grant({ name: name, reason: reason }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.approve_grant(::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, approve_grant_client_stub.call_count + end + end + end + + def test_deny_grant + # Create test objects. + client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = "hello world" + + deny_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_deny_grant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deny_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.deny_grant({ name: name, reason: reason }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.deny_grant name: name, reason: reason do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.deny_grant ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.deny_grant({ name: name, reason: reason }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.deny_grant(::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deny_grant_client_stub.call_count + end + end + end + + def test_revoke_grant + # Create test objects. + 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" + reason = "hello world" + + revoke_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_revoke_grant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, revoke_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.revoke_grant({ name: name, reason: reason }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.revoke_grant name: name, reason: reason do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.revoke_grant ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.revoke_grant({ name: name, reason: reason }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.revoke_grant(::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, revoke_grant_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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb new file mode 100644 index 000000000000..baa180203613 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb @@ -0,0 +1,1024 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" +require "google/cloud/privileged_access_manager/v1/privileged_access_manager" + +class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_check_onboarding_status + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + check_onboarding_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :check_onboarding_status, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, check_onboarding_status_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.check_onboarding_status({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.check_onboarding_status parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.check_onboarding_status ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.check_onboarding_status({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.check_onboarding_status(::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.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, check_onboarding_status_client_stub.call_rpc_count + end + end + + def test_list_entitlements + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_entitlements_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_entitlements, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, 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_entitlements_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_entitlements({ 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_entitlements 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_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements({ 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_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements_client_stub.call_rpc_count + end + end + + def test_search_entitlements + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + caller_access_type = :CALLER_ACCESS_TYPE_UNSPECIFIED + filter = "hello world" + page_size = 42 + page_token = "hello world" + + search_entitlements_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_entitlements, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :CALLER_ACCESS_TYPE_UNSPECIFIED, request["caller_access_type"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_entitlements_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_entitlements parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_entitlements_client_stub.call_rpc_count + end + end + + def test_get_entitlement + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_entitlement, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_entitlement({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_entitlement name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_entitlement({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_entitlement_client_stub.call_rpc_count + end + end + + def test_create_entitlement + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entitlement_id = "hello world" + entitlement = {} + request_id = "hello world" + + create_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_entitlement, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["entitlement_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement), request["entitlement"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement_client_stub.call_rpc_count + end + end + + def test_delete_entitlement + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + force = true + + delete_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_entitlement, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_entitlement({ name: name, request_id: request_id, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_entitlement name: name, request_id: request_id, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_entitlement({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_entitlement_client_stub.call_rpc_count + end + end + + def test_update_entitlement + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + entitlement = {} + update_mask = {} + + update_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_entitlement, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement), request["entitlement"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_entitlement_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_entitlement({ entitlement: entitlement, 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_entitlement entitlement: entitlement, 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_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, 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_entitlement({ entitlement: entitlement, 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_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, 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_entitlement_client_stub.call_rpc_count + end + end + + def test_list_grants + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_grants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_grants, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, 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_grants_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_grants({ 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_grants 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_grants ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants({ 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_grants(::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants_client_stub.call_rpc_count + end + end + + def test_search_grants + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + caller_relationship = :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED + filter = "hello world" + page_size = 42 + page_token = "hello world" + + search_grants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_grants, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED, request["caller_relationship"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_grants_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_grants parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_grants ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_grants(::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_grants_client_stub.call_rpc_count + end + end + + def test_get_grant + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_grant, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_grant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_grant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_grant ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_grant({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_grant(::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_grant_client_stub.call_rpc_count + end + end + + def test_create_grant + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + grant = {} + request_id = "hello world" + + create_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_grant, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Grant), request["grant"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_grant({ parent: parent, grant: grant, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_grant parent: parent, grant: grant, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_grant ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, 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_grant({ parent: parent, grant: grant, 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_grant(::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, 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_grant_client_stub.call_rpc_count + end + end + + def test_approve_grant + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = "hello world" + + approve_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :approve_grant, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["reason"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, approve_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.approve_grant({ name: name, reason: reason }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.approve_grant name: name, reason: reason do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.approve_grant ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.approve_grant({ name: name, reason: reason }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.approve_grant(::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, approve_grant_client_stub.call_rpc_count + end + end + + def test_deny_grant + # Create GRPC objects. + grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = "hello world" + + deny_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deny_grant, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["reason"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deny_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deny_grant({ name: name, reason: reason }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.deny_grant name: name, reason: reason do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.deny_grant ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.deny_grant({ name: name, reason: reason }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.deny_grant(::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, deny_grant_client_stub.call_rpc_count + end + end + + def test_revoke_grant + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = "hello world" + + revoke_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :revoke_grant, name + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["reason"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, revoke_grant_client_stub do + # Create client + client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.revoke_grant({ name: name, reason: reason }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.revoke_grant name: name, reason: reason do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.revoke_grant ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.revoke_grant({ name: name, reason: reason }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.revoke_grant(::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, revoke_grant_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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.gitignore b/owl-bot-staging/google-cloud-privileged_access_manager/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.repo-metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json new file mode 100644 index 000000000000..ba753b02c55d --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "privilegedaccessmanager.googleapis.com", + "api_shortname": "privilegedaccessmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager/latest", + "distribution_name": "google-cloud-privileged_access_manager", + "is_cloud": true, + "language": "ruby", + "name": "privilegedaccessmanager", + "name_pretty": "Privileged Access Manager API", + "product_documentation": "https://cloud.google.com/iam/docs/pam-overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes.", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/pam-overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml b/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml new file mode 100644 index 000000000000..00b61d8dae1e --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-privileged_access_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-privileged_access_manager.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb b/owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.yardopts b/owl-bot-staging/google-cloud-privileged_access_manager/.yardopts new file mode 100644 index 000000000000..91c776c614b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Privileged Access 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-privileged_access_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md new file mode 100644 index 000000000000..594d59bdf252 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager" + +client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/privileged_access_manager" + +Google::Cloud::PrivilegedAccessManager.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::PrivilegedAccessManager.privileged_access_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-privileged_access_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/privileged_access_manager" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::PrivilegedAccessManager.privileged_access_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-privileged_access_manager/CHANGELOG.md b/owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile new file mode 100644 index 000000000000..59d2c5705f44 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-privileged_access_manager-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-privileged_access_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-privileged_access_manager/LICENSE.md b/owl-bot-staging/google-cloud-privileged_access_manager/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/README.md b/owl-bot-staging/google-cloud-privileged_access_manager/README.md new file mode 100644 index 000000000000..bec43cab7e2f --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/README.md @@ -0,0 +1,189 @@ +# Ruby Client for the Privileged Access Manager API + +Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more. + +## Overview + +Privileged Access Manager (PAM) is a Google Cloud native, managed solution +to secure, manage and audit privileged access while ensuring operational +velocity and developer productivity. + +PAM enables just-in-time, time-bound, approval-based access elevations, +and auditing of privileged access elevations and activity. PAM lets you +define the rules of who can request access, what they can request access +to, and if they should be granted access with or without approvals based +on the sensitivity of the access and emergency of the situation. + +## Concepts + +### Entitlement + +An entitlement is an eligibility or license that allows specified users +(requesters) to request and obtain access to specified resources subject +to a set of conditions such as duration, etc. entitlements can be granted +to both human and non-human principals. + +### Grant + +A grant is an instance of active usage against the entitlement. A user can +place a request for a grant against an entitlement. The request may be +forwarded to an approver for their decision. Once approved, the grant is +activated, ultimately giving the user access (roles/permissions) on a +resource per the criteria specified in entitlement. + +### How does PAM work + +PAM creates and uses a service agent (Google-managed service account) to +perform the required IAM policy changes for granting access at a +specific +resource/access scope. The service agent requires getIAMPolicy and +setIAMPolicy permissions at the appropriate (or higher) access scope +- +Organization/Folder/Project to make policy changes on the resources listed +in PAM entitlements. + +When enabling PAM for a resource scope, the user/ principal performing +that action should have the appropriate permissions at that resource +scope +(resourcemanager.\\{projects|folders|organizations}.setIamPolicy, +resourcemanager.\\{projects|folders|organizations}.getIamPolicy, and +resourcemanager.\\{projects|folders|organizations}.get) to list and grant +the service agent/account the required access to perform IAM policy +changes. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-privileged_access_manager-v*`. +The gem `google-cloud-privileged_access_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-privileged_access_manager/latest) +for this library, google-cloud-privileged_access_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-privileged_access_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/iam/docs/pam-overview) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-privileged_access_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/privilegedaccessmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/privileged_access_manager" + +client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager +request = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new # (request fields as keyword arguments...) +response = client.check_onboarding_status 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-privileged_access_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_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-privileged_access_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager/Rakefile b/owl-bot-staging/google-cloud-privileged_access_manager/Rakefile new file mode 100644 index 000000000000..f085f08dbafc --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1/privileged_access_manager/credentials" + ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-privileged_access_manager" + header "google-cloud-privileged_access_manager rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-privileged_access_manager yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager/google-cloud-privileged_access_manager.gemspec b/owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec new file mode 100644 index 000000000000..ce7be40d79f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/privileged_access_manager/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-privileged_access_manager" + gem.version = Google::Cloud::PrivilegedAccessManager::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes." + gem.summary = "Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more." + 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-privileged_access_manager-v1", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb new file mode 100644 index 000000000000..101eae8872a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_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/privileged_access_manager" unless defined? Google::Cloud::PrivilegedAccessManager::VERSION diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb new file mode 100644 index 000000000000..6f7f6f005ff3 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/privileged_access_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! :privileged_access_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 PrivilegedAccessManager + ## + # Create a new client object for PrivilegedAccessManager. + # + # By default, this returns an instance of + # [Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest/Google-Cloud-PrivilegedAccessManager-V1-PrivilegedAccessManager-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 PrivilegedAccessManager 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 PrivilegedAccessManager service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::PrivilegedAccessManager.privileged_access_manager_available?}. + # + # ## About PrivilegedAccessManager + # + # This API allows customers to manage temporary, request based privileged + # access to their resources. + # + # It defines the following resource model: + # + # * A collection of `Entitlement` resources. An entitlement allows configuring + # (among other things): + # + # * Some kind of privileged access that users can request. + # * A set of users called _requesters_ who can request this access. + # * A maximum duration for which the access can be requested. + # * An optional approval workflow which must be satisfied before access is + # granted. + # + # * A collection of `Grant` resources. A grant is a request by a requester to + # get the privileged access specified in an entitlement for some duration. + # + # After the approval workflow as specified in the entitlement is satisfied, + # the specified access is given to the requester. The access is automatically + # taken back after the requested duration is over. + # + # @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.privileged_access_manager version: :v1, transport: :grpc, &block + require "google/cloud/privileged_access_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::PrivilegedAccessManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::PrivilegedAccessManager.const_get(package_name).const_get(:PrivilegedAccessManager) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PrivilegedAccessManager service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::PrivilegedAccessManager.privileged_access_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 PrivilegedAccessManager service, + # or if the versioned client gem needs an update to support the PrivilegedAccessManager 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.privileged_access_manager_available? version: :v1, transport: :grpc + require "google/cloud/privileged_access_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::PrivilegedAccessManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::PrivilegedAccessManager.const_get package_name + return false unless service_module.const_defined? :PrivilegedAccessManager + service_module = service_module.const_get :PrivilegedAccessManager + 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-privileged_access_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.privileged_access_manager if block_given? + + ::Google::Cloud.configure.privileged_access_manager + end + end + end +end + +helper_path = ::File.join __dir__, "privileged_access_manager", "helpers.rb" +require "google/cloud/privileged_access_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb new file mode 100644 index 000000000000..ff72472c9bc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_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 PrivilegedAccessManager + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb new file mode 100644 index 000000000000..6124c5137dbf --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_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/privileged_access_manager" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::PrivilegedAccessManager::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_privileged_access_manager_grpc + skip unless Google::Cloud::PrivilegedAccessManager.privileged_access_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::PrivilegedAccessManager.privileged_access_manager transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client, client + end + end + + def test_privileged_access_manager_rest + skip unless Google::Cloud::PrivilegedAccessManager.privileged_access_manager_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb new file mode 100644 index 000000000000..d7eb89102b75 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_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/privileged_access_manager/version" + +class Google::Cloud::PrivilegedAccessManager::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::PrivilegedAccessManager::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-privileged_access_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-profiler-v2/.gitignore b/owl-bot-staging/google-cloud-profiler-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json new file mode 100644 index 000000000000..000104226eed --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudprofiler.googleapis.com", + "api_shortname": "cloudprofiler", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest", + "distribution_name": "google-cloud-profiler-v2", + "is_cloud": true, + "language": "ruby", + "name": "cloudprofiler", + "name_pretty": "Cloud Profiler V2 API", + "product_documentation": "https://cloud.google.com/profiler/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. Note that google-cloud-profiler-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-profiler instead. See the readme for more details.", + "ruby-cloud-env-prefix": "PROFILER", + "ruby-cloud-product-url": "https://cloud.google.com/profiler/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml b/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml new file mode 100644 index 000000000000..ffdeb25bb180 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-profiler-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-profiler-v2.rb" diff --git a/owl-bot-staging/google-cloud-profiler-v2/.toys.rb b/owl-bot-staging/google-cloud-profiler-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/.yardopts b/owl-bot-staging/google-cloud-profiler-v2/.yardopts new file mode 100644 index 000000000000..021b712dcf35 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Profiler 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-profiler-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..40dc860dfd73 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-profiler-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-profiler-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/profiler/v2" + +client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/profiler/v2" + +::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler-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/profiler/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-profiler-v2/Gemfile b/owl-bot-staging/google-cloud-profiler-v2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/LICENSE.md b/owl-bot-staging/google-cloud-profiler-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/README.md b/owl-bot-staging/google-cloud-profiler-v2/README.md new file mode 100644 index 000000000000..b92d74e92ca8 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Profiler V2 API + +Manages continuous profiling information. + +Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. + +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 Profiler V2 API. Most users should consider using +the main client gem, +[google-cloud-profiler](https://rubygems.org/gems/google-cloud-profiler). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-profiler-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/cloudprofiler.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/profiler/v2" + +client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new +request = ::Google::Cloud::Profiler::V2::CreateProfileRequest.new # (request fields as keyword arguments...) +response = client.create_profile request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/profiler/docs) +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/profiler/v2" +require "logger" + +client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-profiler-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-profiler`. +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-profiler-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-profiler-v2/Rakefile b/owl-bot-staging/google-cloud-profiler-v2/Rakefile new file mode 100644 index 000000000000..7f819b8aa2d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PROFILER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PROFILER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PROFILER_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 PROFILER_TEST_PROJECT=test123 PROFILER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/profiler/v2/profiler_service/credentials" + ::Google::Cloud::Profiler::V2::ProfilerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PROFILER_PROJECT"] = project + ENV["PROFILER_TEST_PROJECT"] = project + ENV["PROFILER_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-profiler-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-profiler-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-profiler-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-profiler-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-profiler-v2" + header "google-cloud-profiler-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-profiler-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-profiler-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-profiler-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-profiler-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-profiler-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json new file mode 100644 index 000000000000..310894826f49 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.devtools.cloudprofiler.v2", + "libraryPackage": "::Google::Cloud::Profiler::V2", + "services": { + "ProfilerService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Profiler::V2::ProfilerService::Client", + "rpcs": { + "CreateProfile": { + "methods": [ + "create_profile" + ] + }, + "CreateOfflineProfile": { + "methods": [ + "create_offline_profile" + ] + }, + "UpdateProfile": { + "methods": [ + "update_profile" + ] + } + } + } + } + }, + "ExportService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Profiler::V2::ExportService::Client", + "rpcs": { + "ListProfiles": { + "methods": [ + "list_profiles" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec b/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec new file mode 100644 index 000000000000..92f4f65bf935 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/profiler/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-profiler-v2" + gem.version = Google::Cloud::Profiler::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. Note that google-cloud-profiler-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-profiler instead. See the readme for more details." + gem.summary = "Manages continuous profiling information." + 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-profiler-v2/lib/google-cloud-profiler-v2.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-v2.rb new file mode 100644 index 000000000000..9231c126bfc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-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/profiler/v2" diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb new file mode 100644 index 000000000000..6352136f4a54 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/profiler/v2/profiler_service" +require "google/cloud/profiler/v2/export_service" +require "google/cloud/profiler/v2/version" + +module Google + module Cloud + module Profiler + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/profiler/v2" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/profiler/v2" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/profiler/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb new file mode 100644 index 000000000000..1bac0a61fb18 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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/profiler/v2/version" + +require "google/cloud/profiler/v2/export_service/credentials" +require "google/cloud/profiler/v2/export_service/paths" +require "google/cloud/profiler/v2/export_service/client" +require "google/cloud/profiler/v2/export_service/rest" + +module Google + module Cloud + module Profiler + module V2 + ## + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/profiler/v2/export_service" + # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/profiler/v2/export_service/rest" + # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new + # + module ExportService + end + end + end + end +end + +helper_path = ::File.join __dir__, "export_service", "helpers.rb" +require "google/cloud/profiler/v2/export_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb new file mode 100644 index 000000000000..93d108509bf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb @@ -0,0 +1,496 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/devtools/cloudprofiler/v2/profiler_pb" + +module Google + module Cloud + module Profiler + module V2 + module ExportService + ## + # Client for the ExportService service. + # + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :export_service_stub + + ## + # Configure the ExportService Client class. + # + # See {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ExportService clients + # ::Google::Cloud::Profiler::V2::ExportService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Profiler", "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 = 130.0 + default_config.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 ExportService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @export_service_stub.universe_domain + end + + ## + # Create a new ExportService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ExportService 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/devtools/cloudprofiler/v2/profiler_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 + + @export_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Profiler::V2::ExportService::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 + ) + + @export_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @export_service_stub.logger + end + + # Service calls + + ## + # Lists profiles which have been collected so far and for which the caller + # has permission to view. + # + # @overload list_profiles(request, options = nil) + # Pass arguments to `list_profiles` via a request object, either of type + # {::Google::Cloud::Profiler::V2::ListProfilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_profiles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_profiles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of profiles. + # Format: projects/\\{user_project_id} + # @param page_size [::Integer] + # The maximum number of items to return. + # Default page_size is 1000. + # Max limit is 1000. + # @param page_token [::String] + # The token to continue pagination and get profiles from a particular page. + # When paginating, all other parameters provided to `ListProfiles` must match + # the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ExportService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::ListProfilesRequest.new + # + # # Call the list_profiles method. + # result = client.list_profiles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Profiler::V2::Profile. + # p item + # end + # + def list_profiles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::ListProfilesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_profiles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_profiles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_profiles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @export_service_stub.call_rpc :list_profiles, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @export_service_stub, :list_profiles, request, response, 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 ExportService API. + # + # This class represents the configuration for ExportService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_profiles to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Profiler::V2::ExportService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_profiles.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_profiles.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::Profiler::V2::ExportService::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 = "cloudprofiler.googleapis.com" + + config_attr :endpoint, nil, ::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 ExportService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_profiles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_profiles + + # @private + def initialize parent_rpcs = nil + list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles + @list_profiles = ::Gapic::Config::Method.new list_profiles_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb new file mode 100644 index 000000000000..74121d4876e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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 Profiler + module V2 + module ExportService + # Credentials for the ExportService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.write" + ] + self.env_vars = [ + "PROFILER_CREDENTIALS", + "PROFILER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PROFILER_CREDENTIALS_JSON", + "PROFILER_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-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb new file mode 100644 index 000000000000..9eeb61a4ab75 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/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 Profiler + module V2 + module ExportService + # Path helper methods for the ExportService 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-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb new file mode 100644 index 000000000000..6cc46d261d73 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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/profiler/v2/version" + +require "google/cloud/profiler/v2/export_service/credentials" +require "google/cloud/profiler/v2/export_service/paths" +require "google/cloud/profiler/v2/export_service/rest/client" + +module Google + module Cloud + module Profiler + module V2 + ## + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/profiler/v2/export_service/rest" + # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new + # + module ExportService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/profiler/v2/export_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb new file mode 100644 index 000000000000..0e577b286170 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb @@ -0,0 +1,446 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/export_service/rest/service_stub" + +module Google + module Cloud + module Profiler + module V2 + module ExportService + module Rest + ## + # REST client for the ExportService service. + # + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :export_service_stub + + ## + # Configure the ExportService Client class. + # + # See {::Google::Cloud::Profiler::V2::ExportService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ExportService clients + # ::Google::Cloud::Profiler::V2::ExportService::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", "Profiler", "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 = 130.0 + default_config.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 ExportService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Profiler::V2::ExportService::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 + @export_service_stub.universe_domain + end + + ## + # Create a new ExportService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ExportService 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 + + @export_service_stub = ::Google::Cloud::Profiler::V2::ExportService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @export_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @export_service_stub.logger + end + + # Service calls + + ## + # Lists profiles which have been collected so far and for which the caller + # has permission to view. + # + # @overload list_profiles(request, options = nil) + # Pass arguments to `list_profiles` via a request object, either of type + # {::Google::Cloud::Profiler::V2::ListProfilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_profiles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_profiles` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of profiles. + # Format: projects/\\{user_project_id} + # @param page_size [::Integer] + # The maximum number of items to return. + # Default page_size is 1000. + # Max limit is 1000. + # @param page_token [::String] + # The token to continue pagination and get profiles from a particular page. + # When paginating, all other parameters provided to `ListProfiles` must match + # the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ExportService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::ListProfilesRequest.new + # + # # Call the list_profiles method. + # result = client.list_profiles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Profiler::V2::Profile. + # p item + # end + # + def list_profiles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::ListProfilesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_profiles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_profiles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_profiles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @export_service_stub.list_profiles request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @export_service_stub, :list_profiles, "profiles", request, result, 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 ExportService REST API. + # + # This class represents the configuration for ExportService 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::Profiler::V2::ExportService::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_profiles to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_profiles.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_profiles.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "cloudprofiler.googleapis.com" + + config_attr :endpoint, nil, ::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 ExportService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_profiles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_profiles + + # @private + def initialize parent_rpcs = nil + list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles + @list_profiles = ::Gapic::Config::Method.new list_profiles_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb new file mode 100644 index 000000000000..9527d8e9cc3d --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/devtools/cloudprofiler/v2/profiler_pb" + +module Google + module Cloud + module Profiler + module V2 + module ExportService + module Rest + ## + # REST service stub for the ExportService 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_profiles REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::ListProfilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::ListProfilesResponse] + # A result object deserialized from the server's reply + def list_profiles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_profiles_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_profiles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Profiler::V2::ListProfilesResponse.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_profiles REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_profiles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/profiles", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb new file mode 100644 index 000000000000..9105a1cd1ea3 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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/profiler/v2/version" + +require "google/cloud/profiler/v2/profiler_service/credentials" +require "google/cloud/profiler/v2/profiler_service/paths" +require "google/cloud/profiler/v2/profiler_service/client" +require "google/cloud/profiler/v2/profiler_service/rest" + +module Google + module Cloud + module Profiler + module V2 + ## + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/profiler/v2/profiler_service" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/profiler/v2/profiler_service/rest" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + module ProfilerService + end + end + end + end +end + +helper_path = ::File.join __dir__, "profiler_service", "helpers.rb" +require "google/cloud/profiler/v2/profiler_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb new file mode 100644 index 000000000000..b4c2aa671fed --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb @@ -0,0 +1,716 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/devtools/cloudprofiler/v2/profiler_pb" + +module Google + module Cloud + module Profiler + module V2 + module ProfilerService + ## + # Client for the ProfilerService service. + # + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :profiler_service_stub + + ## + # Configure the ProfilerService Client class. + # + # See {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProfilerService clients + # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Profiler", "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: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_profile.timeout = 3610.0 + + default_config.rpcs.create_offline_profile.timeout = 30.0 + + default_config.rpcs.update_profile.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProfilerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @profiler_service_stub.universe_domain + end + + ## + # Create a new ProfilerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProfilerService 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/devtools/cloudprofiler/v2/profiler_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 + + @profiler_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Profiler::V2::ProfilerService::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 + ) + + @profiler_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @profiler_service_stub.logger + end + + # Service calls + + ## + # CreateProfile creates a new profile resource in the online mode. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # The server ensures that the new profiles are created at a constant rate per + # deployment, so the creation request may hang for some time until the next + # profile session is available. + # + # The request may fail with ABORTED error if the creation is not available + # within ~1m, the response will indicate the duration of the backoff the + # client should take before attempting creating a profile again. The backoff + # duration is returned in google.rpc.RetryInfo extension on the response + # status. To a gRPC client, the extension will be return as a + # binary-serialized proto in the trailing metadata item named + # "google.rpc.retryinfo-bin". + # + # @overload create_profile(request, options = nil) + # Pass arguments to `create_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::CreateProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_profile(parent: nil, deployment: nil, profile_type: nil) + # Pass arguments to `create_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent project to create the profile in. + # @param deployment [::Google::Cloud::Profiler::V2::Deployment, ::Hash] + # Deployment details. + # @param profile_type [::Array<::Google::Cloud::Profiler::V2::ProfileType>] + # One or more profile types that the agent is capable of providing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new + # + # # Call the create_profile method. + # result = client.create_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def create_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.call_rpc :create_profile, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # CreateOfflineProfile creates a new profile resource in the offline + # mode. The client provides the profile to create along with the profile + # bytes, the server records it. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # @overload create_offline_profile(request, options = nil) + # Pass arguments to `create_offline_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_offline_profile(parent: nil, profile: nil) + # Pass arguments to `create_offline_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent project to create the profile in. + # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] + # Contents of the profile to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new + # + # # Call the create_offline_profile method. + # result = client.create_offline_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def create_offline_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest + + # Converts hash and nil to 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_offline_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_offline_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_offline_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.call_rpc :create_offline_profile, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # UpdateProfile updates the profile bytes and labels on the profile resource + # created in the online mode. Updating the bytes for profiles created in the + # offline mode is currently not supported: the profile content must be + # provided at the time of the profile creation. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # @overload update_profile(request, options = nil) + # Pass arguments to `update_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::UpdateProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_profile(profile: nil, update_mask: nil) + # Pass arguments to `update_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] + # Profile to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask used to specify the fields to be overwritten. Currently only + # profile_bytes and labels fields are supported by UpdateProfile, so only + # those fields can be specified in the mask. When no mask is provided, all + # fields are overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new + # + # # Call the update_profile method. + # result = client.update_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def update_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::UpdateProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.profile&.name + header_params["profile.name"] = request.profile.name + end + + request_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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.call_rpc :update_profile, request, 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 ProfilerService API. + # + # This class represents the configuration for ProfilerService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_profile to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_profile.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_profile.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::Profiler::V2::ProfilerService::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 = "cloudprofiler.googleapis.com" + + config_attr :endpoint, nil, ::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 ProfilerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_profile + ## + # RPC-specific configuration for `create_offline_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_offline_profile + ## + # RPC-specific configuration for `update_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :update_profile + + # @private + def initialize parent_rpcs = nil + create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile + @create_profile = ::Gapic::Config::Method.new create_profile_config + create_offline_profile_config = parent_rpcs.create_offline_profile if parent_rpcs.respond_to? :create_offline_profile + @create_offline_profile = ::Gapic::Config::Method.new create_offline_profile_config + update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile + @update_profile = ::Gapic::Config::Method.new update_profile_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb new file mode 100644 index 000000000000..d125dc8dfc4c --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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 Profiler + module V2 + module ProfilerService + # Credentials for the ProfilerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring", + "https://www.googleapis.com/auth/monitoring.write" + ] + self.env_vars = [ + "PROFILER_CREDENTIALS", + "PROFILER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PROFILER_CREDENTIALS_JSON", + "PROFILER_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-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb new file mode 100644 index 000000000000..8300f672e7c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/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 Profiler + module V2 + module ProfilerService + # Path helper methods for the ProfilerService API. + module Paths + ## + # Create a fully-qualified Profile resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/profiles/{profile}` + # + # @param project [String] + # @param profile [String] + # + # @return [::String] + def profile_path project:, profile: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/profiles/#{profile}" + 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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb new file mode 100644 index 000000000000..43e0389fc4e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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/profiler/v2/version" + +require "google/cloud/profiler/v2/profiler_service/credentials" +require "google/cloud/profiler/v2/profiler_service/paths" +require "google/cloud/profiler/v2/profiler_service/rest/client" + +module Google + module Cloud + module Profiler + module V2 + ## + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/profiler/v2/profiler_service/rest" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + module ProfilerService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/profiler/v2/profiler_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb new file mode 100644 index 000000000000..42d6c4dd2589 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb @@ -0,0 +1,652 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/profiler_service/rest/service_stub" + +module Google + module Cloud + module Profiler + module V2 + module ProfilerService + module Rest + ## + # REST client for the ProfilerService service. + # + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :profiler_service_stub + + ## + # Configure the ProfilerService Client class. + # + # See {::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProfilerService clients + # ::Google::Cloud::Profiler::V2::ProfilerService::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", "Profiler", "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: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_profile.timeout = 3610.0 + + default_config.rpcs.create_offline_profile.timeout = 30.0 + + default_config.rpcs.update_profile.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProfilerService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Profiler::V2::ProfilerService::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 + @profiler_service_stub.universe_domain + end + + ## + # Create a new ProfilerService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProfilerService 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 + + @profiler_service_stub = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @profiler_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @profiler_service_stub.logger + end + + # Service calls + + ## + # CreateProfile creates a new profile resource in the online mode. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # The server ensures that the new profiles are created at a constant rate per + # deployment, so the creation request may hang for some time until the next + # profile session is available. + # + # The request may fail with ABORTED error if the creation is not available + # within ~1m, the response will indicate the duration of the backoff the + # client should take before attempting creating a profile again. The backoff + # duration is returned in google.rpc.RetryInfo extension on the response + # status. To a gRPC client, the extension will be return as a + # binary-serialized proto in the trailing metadata item named + # "google.rpc.retryinfo-bin". + # + # @overload create_profile(request, options = nil) + # Pass arguments to `create_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::CreateProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_profile(parent: nil, deployment: nil, profile_type: nil) + # Pass arguments to `create_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent project to create the profile in. + # @param deployment [::Google::Cloud::Profiler::V2::Deployment, ::Hash] + # Deployment details. + # @param profile_type [::Array<::Google::Cloud::Profiler::V2::ProfileType>] + # One or more profile types that the agent is capable of providing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new + # + # # Call the create_profile method. + # result = client.create_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def create_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.create_profile request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # CreateOfflineProfile creates a new profile resource in the offline + # mode. The client provides the profile to create along with the profile + # bytes, the server records it. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # @overload create_offline_profile(request, options = nil) + # Pass arguments to `create_offline_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_offline_profile(parent: nil, profile: nil) + # Pass arguments to `create_offline_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent project to create the profile in. + # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] + # Contents of the profile to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new + # + # # Call the create_offline_profile method. + # result = client.create_offline_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def create_offline_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest + + # Converts hash and nil to an 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_offline_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_offline_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_offline_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.create_offline_profile request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # UpdateProfile updates the profile bytes and labels on the profile resource + # created in the online mode. Updating the bytes for profiles created in the + # offline mode is currently not supported: the profile content must be + # provided at the time of the profile creation. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # @overload update_profile(request, options = nil) + # Pass arguments to `update_profile` via a request object, either of type + # {::Google::Cloud::Profiler::V2::UpdateProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_profile(profile: nil, update_mask: nil) + # Pass arguments to `update_profile` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] + # Profile to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask used to specify the fields to be overwritten. Currently only + # profile_bytes and labels fields are supported by UpdateProfile, so only + # those fields can be specified in the mask. When no mask is provided, all + # fields are overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/profiler/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new + # + # # Call the update_profile method. + # result = client.update_profile request + # + # # The returned object is of type Google::Cloud::Profiler::V2::Profile. + # p result + # + def update_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::UpdateProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Profiler::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @profiler_service_stub.update_profile request, 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 ProfilerService REST API. + # + # This class represents the configuration for ProfilerService 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::Profiler::V2::ProfilerService::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_profile to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_profile.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_profile.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "cloudprofiler.googleapis.com" + + config_attr :endpoint, nil, ::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 ProfilerService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_profile + ## + # RPC-specific configuration for `create_offline_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_offline_profile + ## + # RPC-specific configuration for `update_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :update_profile + + # @private + def initialize parent_rpcs = nil + create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile + @create_profile = ::Gapic::Config::Method.new create_profile_config + create_offline_profile_config = parent_rpcs.create_offline_profile if parent_rpcs.respond_to? :create_offline_profile + @create_offline_profile = ::Gapic::Config::Method.new create_offline_profile_config + update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile + @update_profile = ::Gapic::Config::Method.new update_profile_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb new file mode 100644 index 000000000000..5ef06ad70490 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.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 "google/devtools/cloudprofiler/v2/profiler_pb" + +module Google + module Cloud + module Profiler + module V2 + module ProfilerService + module Rest + ## + # REST service stub for the ProfilerService 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_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::CreateProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # A result object deserialized from the server's reply + def create_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Profiler::V2::Profile.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_offline_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # A result object deserialized from the server's reply + def create_offline_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_offline_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_offline_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Profiler::V2::Profile.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_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::UpdateProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Profiler::V2::Profile] + # A result object deserialized from the server's reply + def update_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Profiler::V2::Profile.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_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::CreateProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/profiles", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_offline_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest] + # 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_offline_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/profiles:createOffline", + body: "profile", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_profile REST call + # + # @param request_pb [::Google::Cloud::Profiler::V2::UpdateProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{profile.name}", + body: "profile", + matches: [ + ["profile.name", %r{^projects/[^/]+/profiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb new file mode 100644 index 000000000000..35e832c85ba4 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/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/profiler/v2/profiler_service/rest" +require "google/cloud/profiler/v2/export_service/rest" +require "google/cloud/profiler/v2/version" + +module Google + module Cloud + module Profiler + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/profiler/v2/rest" + # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb new file mode 100644 index 000000000000..b46c1f8cb5ef --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/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 Profiler + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb new file mode 100644 index 000000000000..ee50197ebffc --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/devtools/cloudprofiler/v2/profiler.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/protobuf/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/devtools/cloudprofiler/v2/profiler.proto\x12 google.devtools.cloudprofiler.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x01\n\x14\x43reateProfileRequest\x12@\n\x06parent\x18\x04 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12@\n\ndeployment\x18\x01 \x01(\x0b\x32,.google.devtools.cloudprofiler.v2.Deployment\x12\x43\n\x0cprofile_type\x18\x02 \x03(\x0e\x32-.google.devtools.cloudprofiler.v2.ProfileType\"\x9b\x01\n\x1b\x43reateOfflineProfileRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12:\n\x07profile\x18\x02 \x01(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\"\x83\x01\n\x14UpdateProfileRequest\x12:\n\x07profile\x18\x01 \x01(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xee\x03\n\x07Profile\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x43\n\x0cprofile_type\x18\x02 \x01(\x0e\x32-.google.devtools.cloudprofiler.v2.ProfileType\x12@\n\ndeployment\x18\x03 \x01(\x0b\x32,.google.devtools.cloudprofiler.v2.Deployment\x12+\n\x08\x64uration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rprofile_bytes\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x04\x12J\n\x06labels\x18\x06 \x03(\x0b\x32\x35.google.devtools.cloudprofiler.v2.Profile.LabelsEntryB\x03\xe0\x41\x04\x12\x33\n\nstart_time\x18\x07 \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:P\xea\x41M\n$cloudprofiler.googleapis.com/Profile\x12%projects/{project}/profiles/{profile}\"\xa9\x01\n\nDeployment\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x0e\n\x06target\x18\x02 \x01(\t\x12H\n\x06labels\x18\x03 \x03(\x0b\x32\x38.google.devtools.cloudprofiler.v2.Deployment.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x81\x01\n\x13ListProfilesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x86\x01\n\x14ListProfilesResponse\x12;\n\x08profiles\x18\x01 \x03(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x18\n\x10skipped_profiles\x18\x03 \x01(\x05*\x84\x01\n\x0bProfileType\x12\x1c\n\x18PROFILE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x43PU\x10\x01\x12\x08\n\x04WALL\x10\x02\x12\x08\n\x04HEAP\x10\x03\x12\x0b\n\x07THREADS\x10\x04\x12\x0e\n\nCONTENTION\x10\x05\x12\r\n\tPEAK_HEAP\x10\x06\x12\x0e\n\nHEAP_ALLOC\x10\x07\x32\xfe\x05\n\x0fProfilerService\x12\x9f\x01\n\rCreateProfile\x12\x36.google.devtools.cloudprofiler.v2.CreateProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"+\x82\xd3\xe4\x93\x02%\" /v2/{parent=projects/*}/profiles:\x01*\x12\xd2\x01\n\x14\x43reateOfflineProfile\x12=.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"P\xda\x41\x0eparent,profile\x82\xd3\xe4\x93\x02\x39\"./v2/{parent=projects/*}/profiles:createOffline:\x07profile\x12\xc3\x01\n\rUpdateProfile\x12\x36.google.devtools.cloudprofiler.v2.UpdateProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"O\xda\x41\x13profile,update_mask\x82\xd3\xe4\x93\x02\x33\x32(/v2/{profile.name=projects/*/profiles/*}:\x07profile\x1a\xad\x01\xca\x41\x1c\x63loudprofiler.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.write2\xf2\x02\n\rExportService\x12\xb0\x01\n\x0cListProfiles\x12\x35.google.devtools.cloudprofiler.v2.ListProfilesRequest\x1a\x36.google.devtools.cloudprofiler.v2.ListProfilesResponse\"1\xda\x41\x06parent\x82\xd3\xe4\x93\x02\"\x12 /v2/{parent=projects/*}/profiles\x1a\xad\x01\xca\x41\x1c\x63loudprofiler.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.writeB\xd4\x01\n$com.google.devtools.cloudprofiler.v2B\rProfilerProtoP\x01ZGcloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb;cloudprofilerpb\xaa\x02\x18Google.Cloud.Profiler.V2\xca\x02\x18Google\\Cloud\\Profiler\\V2\xea\x02\x1bGoogle::Cloud::Profiler::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.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.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 Profiler + module V2 + CreateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.CreateProfileRequest").msgclass + CreateOfflineProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest").msgclass + UpdateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.UpdateProfileRequest").msgclass + Profile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.Profile").msgclass + Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.Deployment").msgclass + ListProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ListProfilesRequest").msgclass + ListProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ListProfilesResponse").msgclass + ProfileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ProfileType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb new file mode 100644 index 000000000000..13170530a7a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb @@ -0,0 +1,104 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/devtools/cloudprofiler/v2/profiler.proto for package 'Google.Cloud.Profiler.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/devtools/cloudprofiler/v2/profiler_pb' + +module Google + module Cloud + module Profiler + module V2 + module ProfilerService + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.devtools.cloudprofiler.v2.ProfilerService' + + # CreateProfile creates a new profile resource in the online mode. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + # + # The server ensures that the new profiles are created at a constant rate per + # deployment, so the creation request may hang for some time until the next + # profile session is available. + # + # The request may fail with ABORTED error if the creation is not available + # within ~1m, the response will indicate the duration of the backoff the + # client should take before attempting creating a profile again. The backoff + # duration is returned in google.rpc.RetryInfo extension on the response + # status. To a gRPC client, the extension will be return as a + # binary-serialized proto in the trailing metadata item named + # "google.rpc.retryinfo-bin". + # + rpc :CreateProfile, ::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Google::Cloud::Profiler::V2::Profile + # CreateOfflineProfile creates a new profile resource in the offline + # mode. The client provides the profile to create along with the profile + # bytes, the server records it. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + rpc :CreateOfflineProfile, ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Google::Cloud::Profiler::V2::Profile + # UpdateProfile updates the profile bytes and labels on the profile resource + # created in the online mode. Updating the bytes for profiles created in the + # offline mode is currently not supported: the profile content must be + # provided at the time of the profile creation. + # + # _Direct use of this API is discouraged, please use a [supported + # profiler + # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) + # instead for profile collection._ + rpc :UpdateProfile, ::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Google::Cloud::Profiler::V2::Profile + end + + Stub = Service.rpc_stub_class + end + module ExportService + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.devtools.cloudprofiler.v2.ExportService' + + # Lists profiles which have been collected so far and for which the caller + # has permission to view. + rpc :ListProfiles, ::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Google::Cloud::Profiler::V2::ListProfilesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md new file mode 100644 index 000000000000..94d3738b5a08 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Profiler 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-profiler-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb new file mode 100644 index 000000000000..e84a3616933c --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.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 Profiler + module V2 + # CreateProfileRequest describes a profile resource online creation request. + # The deployment field must be populated. The profile_type specifies the list + # of profile types supported by the agent. The creation call will hang until a + # profile of one of these types needs to be collected. + # @!attribute [rw] parent + # @return [::String] + # Parent project to create the profile in. + # @!attribute [rw] deployment + # @return [::Google::Cloud::Profiler::V2::Deployment] + # Deployment details. + # @!attribute [rw] profile_type + # @return [::Array<::Google::Cloud::Profiler::V2::ProfileType>] + # One or more profile types that the agent is capable of providing. + class CreateProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreateOfflineProfileRequest describes a profile resource offline creation + # request. + # @!attribute [rw] parent + # @return [::String] + # Parent project to create the profile in. + # @!attribute [rw] profile + # @return [::Google::Cloud::Profiler::V2::Profile] + # Contents of the profile to create. + class CreateOfflineProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpdateProfileRequest contains the profile to update. + # @!attribute [rw] profile + # @return [::Google::Cloud::Profiler::V2::Profile] + # Profile to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask used to specify the fields to be overwritten. Currently only + # profile_bytes and labels fields are supported by UpdateProfile, so only + # those fields can be specified in the mask. When no mask is provided, all + # fields are overwritten. + class UpdateProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Profile resource. + # @!attribute [r] name + # @return [::String] + # Output only. Opaque, server-assigned, unique ID for this profile. + # @!attribute [rw] profile_type + # @return [::Google::Cloud::Profiler::V2::ProfileType] + # Type of profile. + # For offline mode, this must be specified when creating the profile. For + # online mode it is assigned and returned by the server. + # @!attribute [rw] deployment + # @return [::Google::Cloud::Profiler::V2::Deployment] + # Deployment this profile corresponds to. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration of the profiling session. + # Input (for the offline mode) or output (for the online mode). + # The field represents requested profiling duration. It may slightly differ + # from the effective profiling duration, which is recorded in the profile + # data, in case the profiling can't be stopped immediately (e.g. in case + # stopping the profiling is handled asynchronously). + # @!attribute [rw] profile_bytes + # @return [::String] + # Input only. Profile bytes, as a gzip compressed serialized proto, the + # format is https://github.com/google/pprof/blob/master/proto/profile.proto. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Input only. Labels associated to this specific profile. These labels will + # get merged with the deployment labels for the final data set. See + # documentation on deployment labels for validation rules and limits. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Start time for the profile. + # This output is only present in response from the ListProfiles method. + class Profile + 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 + + # Deployment contains the deployment identification information. + # @!attribute [rw] project_id + # @return [::String] + # Project ID is the ID of a cloud project. + # Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + # @!attribute [rw] target + # @return [::String] + # Target is the service name used to group related deployments: + # * Service name for App Engine Flex / Standard. + # * Cluster and container name for GKE. + # * User-specified string for direct Compute Engine profiling (e.g. Java). + # * Job name for Dataflow. + # Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels identify the deployment within the user universe and same target. + # Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # Value for an individual label must be <= 512 bytes, the total + # size of all label names and values must be <= 1024 bytes. + # + # Label named "language" can be used to record the programming language of + # the profiled deployment. The standard choices for the value include "java", + # "go", "python", "ruby", "nodejs", "php", "dotnet". + # + # For deployments running on Google Cloud Platform, "zone" or "region" label + # should be present describing the deployment location. An example of a zone + # is "us-central1-a", an example of a region is "us-central1" or + # "us-central". + class Deployment + 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 + + # ListProfilesRequest contains request parameters for listing profiles for + # deployments in projects which the user has permissions to view. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of profiles. + # Format: projects/\\{user_project_id} + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # Default page_size is 1000. + # Max limit is 1000. + # @!attribute [rw] page_token + # @return [::String] + # The token to continue pagination and get profiles from a particular page. + # When paginating, all other parameters provided to `ListProfiles` must match + # the call that provided the page token. + class ListProfilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListProfileResponse contains the list of collected profiles for deployments + # in projects which the user has permissions to view. + # @!attribute [rw] profiles + # @return [::Array<::Google::Cloud::Profiler::V2::Profile>] + # List of profiles fetched. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to receive the next page of results. + # This field maybe empty if there are no more profiles to fetch. + # @!attribute [rw] skipped_profiles + # @return [::Integer] + # Number of profiles that were skipped in the current page since they were + # not able to be fetched successfully. This should typically be zero. A + # non-zero value may indicate a transient failure, in which case if the + # number is too high for your use case, the call may be retried. + class ListProfilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ProfileType is type of profiling data. + # NOTE: the enumeration member names are used (in lowercase) as unique string + # identifiers of profile types, so they must not be renamed. + module ProfileType + # Unspecified profile type. + PROFILE_TYPE_UNSPECIFIED = 0 + + # Thread CPU time sampling. + CPU = 1 + + # Wallclock time sampling. More expensive as stops all threads. + WALL = 2 + + # In-use heap profile. Represents a snapshot of the allocations that are + # live at the time of the profiling. + HEAP = 3 + + # Single-shot collection of all thread stacks. + THREADS = 4 + + # Synchronization contention profile. + CONTENTION = 5 + + # Peak heap profile. + PEAK_HEAP = 6 + + # Heap allocation profile. It represents the aggregation of all allocations + # made over the duration of the profile. All allocations are included, + # including those that might have been freed by the end of the profiling + # interval. The profile is in particular useful for garbage collecting + # languages to understand which parts of the code create most of the garbage + # collection pressure to see if those can be optimized. + HEAP_ALLOC = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-profiler-v2/snippets/Gemfile new file mode 100644 index 000000000000..cf6ec181be06 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler-v2", path: "../" +else + gem "google-cloud-profiler-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-profiler-v2/snippets/export_service/list_profiles.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.rb new file mode 100644 index 000000000000..dc35344789e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.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 cloudprofiler_v2_generated_ExportService_ListProfiles_sync] +require "google/cloud/profiler/v2" + +## +# Snippet for the list_profiles call in the ExportService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ExportService::Client#list_profiles. +# +def list_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ExportService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::ListProfilesRequest.new + + # Call the list_profiles method. + result = client.list_profiles request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Profiler::V2::Profile. + p item + end +end +# [END cloudprofiler_v2_generated_ExportService_ListProfiles_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb new file mode 100644 index 000000000000..9c9dc21ec20a --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] +require "google/cloud/profiler/v2" + +## +# Snippet for the create_offline_profile call in the ProfilerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile. +# +def create_offline_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new + + # Call the create_offline_profile method. + result = client.create_offline_profile request + + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end +# [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb new file mode 100644 index 000000000000..54bbbe15c0f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] +require "google/cloud/profiler/v2" + +## +# Snippet for the create_profile call in the ProfilerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile. +# +def create_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::CreateProfileRequest.new + + # Call the create_profile method. + result = client.create_profile request + + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end +# [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb new file mode 100644 index 000000000000..b0bde777d839 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] +require "google/cloud/profiler/v2" + +## +# Snippet for the update_profile call in the ProfilerService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile. +# +def update_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new + + # Call the update_profile method. + result = client.update_profile request + + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end +# [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json b/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json new file mode 100644 index 000000000000..9060c42194ed --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-profiler-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.devtools.cloudprofiler.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync", + "title": "Snippet for the create_profile call in the ProfilerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile.", + "file": "profiler_service/create_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_profile", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Profiler::V2::CreateProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Profiler::V2::Profile", + "client": { + "short_name": "ProfilerService::Client", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" + }, + "method": { + "short_name": "CreateProfile", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile", + "service": { + "short_name": "ProfilerService", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync", + "title": "Snippet for the create_offline_profile call in the ProfilerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile.", + "file": "profiler_service/create_offline_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_offline_profile", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Profiler::V2::Profile", + "client": { + "short_name": "ProfilerService::Client", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" + }, + "method": { + "short_name": "CreateOfflineProfile", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile", + "service": { + "short_name": "ProfilerService", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync", + "title": "Snippet for the update_profile call in the ProfilerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile.", + "file": "profiler_service/update_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_profile", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Profiler::V2::UpdateProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Profiler::V2::Profile", + "client": { + "short_name": "ProfilerService::Client", + "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" + }, + "method": { + "short_name": "UpdateProfile", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile", + "service": { + "short_name": "ProfilerService", + "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudprofiler_v2_generated_ExportService_ListProfiles_sync", + "title": "Snippet for the list_profiles call in the ExportService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ExportService::Client#list_profiles.", + "file": "export_service/list_profiles.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_profiles", + "full_name": "::Google::Cloud::Profiler::V2::ExportService::Client#list_profiles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Profiler::V2::ListProfilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Profiler::V2::ListProfilesResponse", + "client": { + "short_name": "ExportService::Client", + "full_name": "::Google::Cloud::Profiler::V2::ExportService::Client" + }, + "method": { + "short_name": "ListProfiles", + "full_name": "google.devtools.cloudprofiler.v2.ExportService.ListProfiles", + "service": { + "short_name": "ExportService", + "full_name": "google.devtools.cloudprofiler.v2.ExportService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb new file mode 100644 index 000000000000..9dafe37c9e1c --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_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/profiler/v2/export_service" + +class ::Google::Cloud::Profiler::V2::ExportService::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::Profiler::V2::ExportService::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-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb new file mode 100644 index 000000000000..b18c1405d007 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_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/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/export_service/rest" + + +class ::Google::Cloud::Profiler::V2::ExportService::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_profiles + # Create test objects. + client_result = ::Google::Cloud::Profiler::V2::ListProfilesResponse.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_profiles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Profiler::V2::ExportService::Rest::ServiceStub.stub :transcode_list_profiles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_profiles_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_profiles({ 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_profiles 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_profiles ::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles({ 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_profiles(::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles_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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb new file mode 100644 index 000000000000..61b92489328d --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/export_service" + +class ::Google::Cloud::Profiler::V2::ExportService::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_profiles + # Create GRPC objects. + grpc_response = ::Google::Cloud::Profiler::V2::ListProfilesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_profiles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_profiles, name + assert_kind_of ::Google::Cloud::Profiler::V2::ListProfilesRequest, 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_profiles_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_profiles({ parent: parent, page_size: page_size, page_token: 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_profiles parent: parent, page_size: page_size, page_token: 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_profiles ::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles({ 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_profiles(::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles_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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Profiler::V2::ExportService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb new file mode 100644 index 000000000000..f2b290d7bb87 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_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/profiler/v2/profiler_service" + +class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.profile_path project: "value0", profile: "value1" + assert_equal "projects/value0/profiles/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::Profiler::V2::ProfilerService::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-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb new file mode 100644 index 000000000000..dcd59318b9d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.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 "helper" +require "gapic/rest" +require "google/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/profiler_service/rest" + + +class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile + # Create test objects. + client_result = ::Google::Cloud::Profiler::V2::Profile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + deployment = {} + profile_type = [:PROFILE_TYPE_UNSPECIFIED] + + create_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_create_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_profile parent: parent, deployment: deployment, profile_type: profile_type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_profile ::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_profile(::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_profile_client_stub.call_count + end + end + end + + def test_create_offline_profile + # Create test objects. + client_result = ::Google::Cloud::Profiler::V2::Profile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + profile = {} + + create_offline_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_create_offline_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_offline_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_offline_profile({ parent: parent, profile: profile }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_offline_profile parent: parent, profile: profile do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_offline_profile ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_offline_profile({ parent: parent, profile: profile }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_offline_profile(::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_offline_profile_client_stub.call_count + end + end + end + + def test_update_profile + # Create test objects. + client_result = ::Google::Cloud::Profiler::V2::Profile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + profile = {} + update_mask = {} + + update_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_update_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_profile({ profile: profile, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_profile profile: profile, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_profile ::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_profile({ profile: profile, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_profile(::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_profile_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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb new file mode 100644 index 000000000000..bf5990b988ce --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/devtools/cloudprofiler/v2/profiler_pb" +require "google/cloud/profiler/v2/profiler_service" + +class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Profiler::V2::Profile.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + deployment = {} + profile_type = [:PROFILE_TYPE_UNSPECIFIED] + + create_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_profile, name + assert_kind_of ::Google::Cloud::Profiler::V2::CreateProfileRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Deployment), request["deployment"] + assert_equal [:PROFILE_TYPE_UNSPECIFIED], request["profile_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_profile parent: parent, deployment: deployment, profile_type: profile_type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_profile ::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_profile(::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_profile_client_stub.call_rpc_count + end + end + + def test_create_offline_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Profiler::V2::Profile.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + profile = {} + + create_offline_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_offline_profile, name + assert_kind_of ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Profile), request["profile"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_offline_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_offline_profile({ parent: parent, profile: profile }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_offline_profile parent: parent, profile: profile do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_offline_profile ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_offline_profile({ parent: parent, profile: profile }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_offline_profile(::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_offline_profile_client_stub.call_rpc_count + end + end + + def test_update_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Profiler::V2::Profile.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + profile = {} + update_mask = {} + + update_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_profile, name + assert_kind_of ::Google::Cloud::Profiler::V2::UpdateProfileRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Profile), request["profile"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_profile_client_stub do + # Create client + client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_profile({ profile: profile, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_profile profile: profile, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_profile ::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, 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_profile({ profile: profile, 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_profile(::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, 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_profile_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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Profiler::V2::ProfilerService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/helper.rb b/owl-bot-staging/google-cloud-profiler-v2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler-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-profiler/.gitignore b/owl-bot-staging/google-cloud-profiler/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/.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-profiler/.repo-metadata.json b/owl-bot-staging/google-cloud-profiler/.repo-metadata.json new file mode 100644 index 000000000000..2ea671bbe7dc --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudprofiler.googleapis.com", + "api_shortname": "cloudprofiler", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-profiler/latest", + "distribution_name": "google-cloud-profiler", + "is_cloud": true, + "language": "ruby", + "name": "cloudprofiler", + "name_pretty": "Cloud Profiler API", + "product_documentation": "https://cloud.google.com/profiler/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code.", + "ruby-cloud-env-prefix": "PROFILER", + "ruby-cloud-product-url": "https://cloud.google.com/profiler/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-profiler/.rubocop.yml b/owl-bot-staging/google-cloud-profiler/.rubocop.yml new file mode 100644 index 000000000000..12806b0627ab --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-profiler.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-profiler.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-profiler/.toys.rb b/owl-bot-staging/google-cloud-profiler/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/.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-profiler/.yardopts b/owl-bot-staging/google-cloud-profiler/.yardopts new file mode 100644 index 000000000000..e4b95f189bd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Profiler 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-profiler/AUTHENTICATION.md b/owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md new file mode 100644 index 000000000000..59121f2318c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-profiler 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-profiler 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/profiler" + +client = Google::Cloud::Profiler.profiler_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/profiler" + +Google::Cloud::Profiler.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Profiler.profiler_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-profiler +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/profiler" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Profiler.profiler_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-profiler/CHANGELOG.md b/owl-bot-staging/google-cloud-profiler/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-profiler/Gemfile b/owl-bot-staging/google-cloud-profiler/Gemfile new file mode 100644 index 000000000000..eebcef710b09 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-profiler-v2"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-profiler.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-profiler/LICENSE.md b/owl-bot-staging/google-cloud-profiler/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/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-profiler/README.md b/owl-bot-staging/google-cloud-profiler/README.md new file mode 100644 index 000000000000..82318ee25c51 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Profiler API + +API Client library for the Cloud Profiler API + +Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-profiler-v*`. +The gem `google-cloud-profiler` 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-profiler/latest) +for this library, google-cloud-profiler, 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-profiler-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest). + +See also the [Product Documentation](https://cloud.google.com/profiler/docs) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-profiler +``` + +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/cloudprofiler.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/profiler" + +client = Google::Cloud::Profiler.profiler_service +request = ::Google::Cloud::Profiler::V2::CreateProfileRequest.new # (request fields as keyword arguments...) +response = client.create_profile 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-profiler-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-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-profiler`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-profiler-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-profiler`. +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-profiler-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-profiler/Rakefile b/owl-bot-staging/google-cloud-profiler/Rakefile new file mode 100644 index 000000000000..d5348d15ab40 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/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-profiler acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PROFILER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PROFILER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PROFILER_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 PROFILER_TEST_PROJECT=test123 PROFILER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/profiler/v2/profiler_service/credentials" + ::Google::Cloud::Profiler::V2::ProfilerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PROFILER_PROJECT"] = project + ENV["PROFILER_TEST_PROJECT"] = project + ENV["PROFILER_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-profiler 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-profiler 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-profiler 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-profiler gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-profiler" + header "google-cloud-profiler rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-profiler yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-profiler 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-profiler 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-profiler 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-profiler/google-cloud-profiler.gemspec b/owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec new file mode 100644 index 000000000000..a8814b82ab05 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/profiler/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-profiler" + gem.version = Google::Cloud::Profiler::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code." + gem.summary = "API Client library for the Cloud Profiler 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-profiler-v2", ">= 0.9", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb b/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb new file mode 100644 index 000000000000..2aeff728ee34 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.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/profiler" unless defined? Google::Cloud::Profiler::VERSION diff --git a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb new file mode 100644 index 000000000000..fda02531c480 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.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! + +# 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/profiler/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! :profiler 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 Profiler + ## + # Create a new client object for ProfilerService. + # + # By default, this returns an instance of + # [Google::Cloud::Profiler::V2::ProfilerService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest/Google-Cloud-Profiler-V2-ProfilerService-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 ProfilerService 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 ProfilerService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Profiler.profiler_service_available?}. + # + # ## About ProfilerService + # + # Manage the collection of continuous profiling data provided by profiling + # agents running in the cloud or by an offline provider of profiling data. + # + # __The APIs listed in this service are intended for use within our profiler + # agents only.__ + # + # @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.profiler_service version: :v2, transport: :grpc, &block + require "google/cloud/profiler/#{version.to_s.downcase}" + + package_name = Google::Cloud::Profiler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Profiler.const_get(package_name).const_get(:ProfilerService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ProfilerService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.profiler_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 ProfilerService service, + # or if the versioned client gem needs an update to support the ProfilerService 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.profiler_service_available? version: :v2, transport: :grpc + require "google/cloud/profiler/#{version.to_s.downcase}" + package_name = Google::Cloud::Profiler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Profiler.const_get package_name + return false unless service_module.const_defined? :ProfilerService + service_module = service_module.const_get :ProfilerService + 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 ExportService. + # + # By default, this returns an instance of + # [Google::Cloud::Profiler::V2::ExportService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest/Google-Cloud-Profiler-V2-ExportService-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 ExportService 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 ExportService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Profiler.export_service_available?}. + # + # ## About ExportService + # + # Service allows existing Cloud Profiler customers to export their profile data + # out of Google Cloud. + # + # @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.export_service version: :v2, transport: :grpc, &block + require "google/cloud/profiler/#{version.to_s.downcase}" + + package_name = Google::Cloud::Profiler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Profiler.const_get(package_name).const_get(:ExportService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ExportService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.export_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 ExportService service, + # or if the versioned client gem needs an update to support the ExportService 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.export_service_available? version: :v2, transport: :grpc + require "google/cloud/profiler/#{version.to_s.downcase}" + package_name = Google::Cloud::Profiler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Profiler.const_get package_name + return false unless service_module.const_defined? :ExportService + service_module = service_module.const_get :ExportService + 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-profiler 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.profiler if block_given? + + ::Google::Cloud.configure.profiler + end + end + end +end + +helper_path = ::File.join __dir__, "profiler", "helpers.rb" +require "google/cloud/profiler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb new file mode 100644 index 000000000000..ae845b29de7a --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/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 Profiler + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb new file mode 100644 index 000000000000..e3a0d1dcc342 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/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/profiler" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Profiler::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_profiler_service_grpc + skip unless Google::Cloud::Profiler.profiler_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::Profiler.profiler_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Profiler::V2::ProfilerService::Client, client + end + end + + def test_profiler_service_rest + skip unless Google::Cloud::Profiler.profiler_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Profiler.profiler_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Profiler::V2::ProfilerService::Rest::Client, client + end + end + + def test_export_service_grpc + skip unless Google::Cloud::Profiler.export_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::Profiler.export_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Profiler::V2::ExportService::Client, client + end + end + + def test_export_service_rest + skip unless Google::Cloud::Profiler.export_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Profiler.export_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Profiler::V2::ExportService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb new file mode 100644 index 000000000000..19e7626008b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/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/profiler/version" + +class Google::Cloud::Profiler::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Profiler::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-profiler/test/helper.rb b/owl-bot-staging/google-cloud-profiler/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-profiler/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-rapid_migration_assessment-v1/.gitignore b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json new file mode 100644 index 000000000000..5a4a90dc723a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "rapidmigrationassessment.googleapis.com", + "api_shortname": "rapidmigrationassessment", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest", + "distribution_name": "google-cloud-rapid_migration_assessment-v1", + "is_cloud": true, + "language": "ruby", + "name": "rapidmigrationassessment", + "name_pretty": "Rapid Migration Assessment V1 API", + "product_documentation": "https://cloud.google.com/migration-center/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Rapid Migration Assessment service is our first-party migration assessment and planning tool. Note that google-cloud-rapid_migration_assessment-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-rapid_migration_assessment instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/migration-center/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml new file mode 100644 index 000000000000..3fbe99c3b327 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1.rb" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/.yardopts b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts new file mode 100644 index 000000000000..9caa2c86cf62 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Rapid Migration Assessment 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-rapid_migration_assessment-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..43687b3914bb --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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/rapid_migration_assessment/v1" + +client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/rapid_migration_assessment/v1" + +::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-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/rapid_migration_assessment/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/LICENSE.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md new file mode 100644 index 000000000000..1cbb78311956 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Rapid Migration Assessment V1 API + +The Rapid Migration Assessment service is our first-party migration assessment and planning tool. + +The Rapid Migration Assessment service is our first-party migration assessment and planning tool. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Rapid Migration Assessment V1 API. Most users should consider using +the main client gem, +[google-cloud-rapid_migration_assessment](https://rubygems.org/gems/google-cloud-rapid_migration_assessment). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-rapid_migration_assessment-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/rapidmigrationassessment.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/rapid_migration_assessment/v1" + +client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new +request = ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new # (request fields as keyword arguments...) +response = client.create_collector request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/migration-center/docs) +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/rapid_migration_assessment/v1" +require "logger" + +client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`. +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-rapid_migration_assessment-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-rapid_migration_assessment-v1/Rakefile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Rakefile new file mode 100644 index 000000000000..8f543dc9c6d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-rapid_migration_assessment-v1" + header "google-cloud-rapid_migration_assessment-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-rapid_migration_assessment-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json new file mode 100644 index 000000000000..3201fa6c244a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.rapidmigrationassessment.v1", + "libraryPackage": "::Google::Cloud::RapidMigrationAssessment::V1", + "services": { + "RapidMigrationAssessment": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client", + "rpcs": { + "CreateCollector": { + "methods": [ + "create_collector" + ] + }, + "CreateAnnotation": { + "methods": [ + "create_annotation" + ] + }, + "GetAnnotation": { + "methods": [ + "get_annotation" + ] + }, + "ListCollectors": { + "methods": [ + "list_collectors" + ] + }, + "GetCollector": { + "methods": [ + "get_collector" + ] + }, + "UpdateCollector": { + "methods": [ + "update_collector" + ] + }, + "DeleteCollector": { + "methods": [ + "delete_collector" + ] + }, + "ResumeCollector": { + "methods": [ + "resume_collector" + ] + }, + "RegisterCollector": { + "methods": [ + "register_collector" + ] + }, + "PauseCollector": { + "methods": [ + "pause_collector" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec new file mode 100644 index 000000000000..f463574e867d --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/rapid_migration_assessment/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-rapid_migration_assessment-v1" + gem.version = Google::Cloud::RapidMigrationAssessment::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool. Note that google-cloud-rapid_migration_assessment-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-rapid_migration_assessment instead. See the readme for more details." + gem.summary = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." + 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-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb new file mode 100644 index 000000000000..3373fa07b8ef --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-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/rapid_migration_assessment/v1" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb new file mode 100644 index 000000000000..7d07419e40b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/v1/rapid_migration_assessment" +require "google/cloud/rapid_migration_assessment/v1/version" + +module Google + module Cloud + module RapidMigrationAssessment + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/rapid_migration_assessment/v1" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/rapid_migration_assessment/v1" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/rapid_migration_assessment/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb new file mode 100644 index 000000000000..1ca77f0f295c --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/rapid_migration_assessment/v1/rest" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RapidMigrationAssessment"] + parent_config = while namespace.any? + parent_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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb new file mode 100644 index 000000000000..c3342b768ad7 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.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/rapid_migration_assessment/v1/version" + +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + ## + # Service describing handlers for resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + module RapidMigrationAssessment + end + end + end + end +end + +helper_path = ::File.join __dir__, "rapid_migration_assessment", "helpers.rb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb new file mode 100644 index 000000000000..8c781eeb8cdd --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb @@ -0,0 +1,1527 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" +require "google/cloud/location" + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + ## + # Client for the RapidMigrationAssessment service. + # + # Service describing handlers for resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :rapid_migration_assessment_stub + + ## + # Configure the RapidMigrationAssessment Client class. + # + # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RapidMigrationAssessment clients + # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RapidMigrationAssessment", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_collector.timeout = 60.0 + + default_config.rpcs.create_annotation.timeout = 60.0 + + default_config.rpcs.get_annotation.timeout = 60.0 + default_config.rpcs.get_annotation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_collectors.timeout = 60.0 + default_config.rpcs.list_collectors.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_collector.timeout = 60.0 + default_config.rpcs.get_collector.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_collector.timeout = 60.0 + + default_config.rpcs.delete_collector.timeout = 60.0 + + default_config.rpcs.resume_collector.timeout = 60.0 + + default_config.rpcs.register_collector.timeout = 60.0 + + default_config.rpcs.pause_collector.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RapidMigrationAssessment Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @rapid_migration_assessment_stub.universe_domain + end + + ## + # Create a new RapidMigrationAssessment client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RapidMigrationAssessment 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/rapidmigrationassessment/v1/rapidmigrationassessment_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 + + @rapid_migration_assessment_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 + ) + + @rapid_migration_assessment_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 = @rapid_migration_assessment_stub.endpoint + config.universe_domain = @rapid_migration_assessment_stub.universe_domain + config.logger = @rapid_migration_assessment_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 + @rapid_migration_assessment_stub.logger + end + + # Service calls + + ## + # Create a Collector to manage the on-prem appliance which collects + # information about Customer assets. + # + # @overload create_collector(request, options = nil) + # Pass arguments to `create_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil) + # Pass arguments to `create_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent (project+location). + # @param collector_id [::String] + # Required. Id of the requesting object. + # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new + # + # # Call the create_collector method. + # result = client.create_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest + + # Converts hash and nil to 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :create_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 Annotation + # + # @overload create_annotation(request, options = nil) + # Pass arguments to `create_annotation` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_annotation(parent: nil, annotation: nil, request_id: nil) + # Pass arguments to `create_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent (project+location). + # @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new + # + # # Call the create_annotation method. + # result = client.create_annotation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest + + # Converts hash and nil to 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_annotation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :create_annotation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 details of a single Annotation. + # + # @overload get_annotation(request, options = nil) + # Pass arguments to `get_annotation` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_annotation(name: nil) + # Pass arguments to `get_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Annotation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new + # + # # Call the get_annotation method. + # result = client.get_annotation request + # + # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. + # p result + # + def get_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_annotation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :get_annotation, request, 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 Collectors in a given project and location. + # + # @overload list_collectors(request, options = nil) + # Pass arguments to `list_collectors` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_collectors` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListCollectorsRequest. + # @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] + # 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::RapidMigrationAssessment::V1::Collector>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new + # + # # Call the list_collectors method. + # result = client.list_collectors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. + # p item + # end + # + def list_collectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_collectors.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_collectors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_collectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :list_collectors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @rapid_migration_assessment_stub, :list_collectors, request, response, 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 Collector. + # + # @overload get_collector(request, options = nil) + # Pass arguments to `get_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_collector(name: nil) + # Pass arguments to `get_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Collector] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new + # + # # Call the get_collector method. + # result = client.get_collector request + # + # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. + # p result + # + def get_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :get_collector, request, 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 parameters of a single Collector. + # + # @overload update_collector(request, options = nil) + # Pass arguments to `update_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_collector(update_mask: nil, collector: nil, request_id: nil) + # Pass arguments to `update_collector` via keyword arguments. Note that at + # least one keyword argument is 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 + # Collector 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 collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] + # Required. The resource being updated. + # @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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new + # + # # Call the update_collector method. + # result = client.update_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest + + # Converts hash and nil to 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.collector&.name + header_params["collector.name"] = request.collector.name + end + + request_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_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :update_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 Collector - changes state of collector to "Deleting". + # Background jobs does final deletion through producer API. + # + # @overload delete_collector(request, options = nil) + # Pass arguments to `delete_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_collector(name: nil, request_id: nil) + # Pass arguments to `delete_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new + # + # # Call the delete_collector method. + # result = client.delete_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :delete_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resumes the given collector. + # + # @overload resume_collector(request, options = nil) + # Pass arguments to `resume_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) + # Pass arguments to `resume_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new + # + # # Call the resume_collector method. + # result = client.resume_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def resume_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest + + # Converts hash and nil to 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :resume_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Registers the given collector. + # + # @overload register_collector(request, options = nil) + # Pass arguments to `register_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload register_collector(name: nil, request_id: nil) + # Pass arguments to `register_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new + # + # # Call the register_collector method. + # result = client.register_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def register_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.register_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.register_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.register_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :register_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the given collector. + # + # @overload pause_collector(request, options = nil) + # Pass arguments to `pause_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) + # Pass arguments to `pause_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new + # + # # Call the pause_collector method. + # result = client.pause_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def pause_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest + + # Converts hash and nil to 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_collector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.call_rpc :pause_collector, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 RapidMigrationAssessment API. + # + # This class represents the configuration for RapidMigrationAssessment, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_collector to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_collector.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_collector.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 = "rapidmigrationassessment.googleapis.com" + + config_attr :endpoint, nil, ::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 RapidMigrationAssessment API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_collector + ## + # RPC-specific configuration for `create_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_annotation + ## + # RPC-specific configuration for `get_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation + ## + # RPC-specific configuration for `list_collectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collectors + ## + # RPC-specific configuration for `get_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_collector + ## + # RPC-specific configuration for `update_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :update_collector + ## + # RPC-specific configuration for `delete_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_collector + ## + # RPC-specific configuration for `resume_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_collector + ## + # RPC-specific configuration for `register_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :register_collector + ## + # RPC-specific configuration for `pause_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_collector + + # @private + def initialize parent_rpcs = nil + create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector + @create_collector = ::Gapic::Config::Method.new create_collector_config + create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation + @create_annotation = ::Gapic::Config::Method.new create_annotation_config + get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation + @get_annotation = ::Gapic::Config::Method.new get_annotation_config + list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors + @list_collectors = ::Gapic::Config::Method.new list_collectors_config + get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector + @get_collector = ::Gapic::Config::Method.new get_collector_config + update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector + @update_collector = ::Gapic::Config::Method.new update_collector_config + delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector + @delete_collector = ::Gapic::Config::Method.new delete_collector_config + resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector + @resume_collector = ::Gapic::Config::Method.new resume_collector_config + register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector + @register_collector = ::Gapic::Config::Method.new register_collector_config + pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector + @pause_collector = ::Gapic::Config::Method.new pause_collector_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb new file mode 100644 index 000000000000..976a42c0b7d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + # Credentials for the RapidMigrationAssessment 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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb new file mode 100644 index 000000000000..48934964490d --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the RapidMigrationAssessment 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 RapidMigrationAssessment 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::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RapidMigrationAssessment::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RapidMigrationAssessment::V1::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 = "rapidmigrationassessment.googleapis.com" + + config_attr :endpoint, nil, ::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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb new file mode 100644 index 000000000000..8ff57cfe326b --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + # Path helper methods for the RapidMigrationAssessment API. + module Paths + ## + # Create a fully-qualified Annotation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/annotations/{annotation}` + # + # @param project [String] + # @param location [String] + # @param annotation [String] + # + # @return [::String] + def annotation_path project:, location:, annotation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/annotations/#{annotation}" + end + + ## + # Create a fully-qualified Collector resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collectors/{collector}` + # + # @param project [String] + # @param location [String] + # @param collector [String] + # + # @return [::String] + def collector_path project:, location:, collector: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collectors/#{collector}" + 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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb new file mode 100644 index 000000000000..b26012a3f87c --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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/rapid_migration_assessment/v1/version" +require "google/cloud/rapid_migration_assessment/v1/bindings_override" + +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client" + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + ## + # Service describing handlers for resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + module RapidMigrationAssessment + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb new file mode 100644 index 000000000000..b9508970a13a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb @@ -0,0 +1,1422 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + module Rest + ## + # REST client for the RapidMigrationAssessment service. + # + # Service describing handlers for resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :rapid_migration_assessment_stub + + ## + # Configure the RapidMigrationAssessment Client class. + # + # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RapidMigrationAssessment clients + # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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", "RapidMigrationAssessment", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_collector.timeout = 60.0 + + default_config.rpcs.create_annotation.timeout = 60.0 + + default_config.rpcs.get_annotation.timeout = 60.0 + default_config.rpcs.get_annotation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_collectors.timeout = 60.0 + default_config.rpcs.list_collectors.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_collector.timeout = 60.0 + default_config.rpcs.get_collector.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_collector.timeout = 60.0 + + default_config.rpcs.delete_collector.timeout = 60.0 + + default_config.rpcs.resume_collector.timeout = 60.0 + + default_config.rpcs.register_collector.timeout = 60.0 + + default_config.rpcs.pause_collector.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RapidMigrationAssessment Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 + @rapid_migration_assessment_stub.universe_domain + end + + ## + # Create a new RapidMigrationAssessment REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RapidMigrationAssessment 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 + + @rapid_migration_assessment_stub = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @rapid_migration_assessment_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 = @rapid_migration_assessment_stub.endpoint + config.universe_domain = @rapid_migration_assessment_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @rapid_migration_assessment_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 + @rapid_migration_assessment_stub.logger + end + + # Service calls + + ## + # Create a Collector to manage the on-prem appliance which collects + # information about Customer assets. + # + # @overload create_collector(request, options = nil) + # Pass arguments to `create_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil) + # Pass arguments to `create_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent (project+location). + # @param collector_id [::String] + # Required. Id of the requesting object. + # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new + # + # # Call the create_collector method. + # result = client.create_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest + + # Converts hash and nil to an 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.create_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Annotation + # + # @overload create_annotation(request, options = nil) + # Pass arguments to `create_annotation` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_annotation(parent: nil, annotation: nil, request_id: nil) + # Pass arguments to `create_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of the parent (project+location). + # @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new + # + # # Call the create_annotation method. + # result = client.create_annotation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest + + # Converts hash and nil to an 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_annotation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.create_annotation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Annotation. + # + # @overload get_annotation(request, options = nil) + # Pass arguments to `get_annotation` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_annotation(name: nil) + # Pass arguments to `get_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new + # + # # Call the get_annotation method. + # result = client.get_annotation request + # + # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. + # p result + # + def get_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_annotation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.get_annotation request, 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 Collectors in a given project and location. + # + # @overload list_collectors(request, options = nil) + # Pass arguments to `list_collectors` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_collectors` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListCollectorsRequest. + # @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] + # 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::RapidMigrationAssessment::V1::Collector>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new + # + # # Call the list_collectors method. + # result = client.list_collectors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. + # p item + # end + # + def list_collectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_collectors.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_collectors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_collectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.list_collectors request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @rapid_migration_assessment_stub, :list_collectors, "collectors", request, result, 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 Collector. + # + # @overload get_collector(request, options = nil) + # Pass arguments to `get_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_collector(name: nil) + # Pass arguments to `get_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Collector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new + # + # # Call the get_collector method. + # result = client.get_collector request + # + # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. + # p result + # + def get_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.get_collector request, 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 parameters of a single Collector. + # + # @overload update_collector(request, options = nil) + # Pass arguments to `update_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_collector(update_mask: nil, collector: nil, request_id: nil) + # Pass arguments to `update_collector` via keyword arguments. Note that at + # least one keyword argument is 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 + # Collector 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 collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] + # Required. The resource being updated. + # @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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new + # + # # Call the update_collector method. + # result = client.update_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest + + # Converts hash and nil to an 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.update_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 Collector - changes state of collector to "Deleting". + # Background jobs does final deletion through producer API. + # + # @overload delete_collector(request, options = nil) + # Pass arguments to `delete_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_collector(name: nil, request_id: nil) + # Pass arguments to `delete_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new + # + # # Call the delete_collector method. + # result = client.delete_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest + + # Converts hash and nil to an 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.delete_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resumes the given collector. + # + # @overload resume_collector(request, options = nil) + # Pass arguments to `resume_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) + # Pass arguments to `resume_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new + # + # # Call the resume_collector method. + # result = client.resume_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def resume_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest + + # Converts hash and nil to an 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.resume_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Registers the given collector. + # + # @overload register_collector(request, options = nil) + # Pass arguments to `register_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload register_collector(name: nil, request_id: nil) + # Pass arguments to `register_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new + # + # # Call the register_collector method. + # result = client.register_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def register_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.register_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.register_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.register_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.register_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the given collector. + # + # @overload pause_collector(request, options = nil) + # Pass arguments to `pause_collector` via a request object, either of type + # {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) + # Pass arguments to `pause_collector` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new + # + # # Call the pause_collector method. + # result = client.pause_collector request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def pause_collector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest + + # Converts hash and nil to an 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_collector.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_collector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rapid_migration_assessment_stub.pause_collector request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 RapidMigrationAssessment REST API. + # + # This class represents the configuration for RapidMigrationAssessment 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_collector.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_collector.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "rapidmigrationassessment.googleapis.com" + + config_attr :endpoint, nil, ::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 RapidMigrationAssessment API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_collector + ## + # RPC-specific configuration for `create_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_annotation + ## + # RPC-specific configuration for `get_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation + ## + # RPC-specific configuration for `list_collectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collectors + ## + # RPC-specific configuration for `get_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_collector + ## + # RPC-specific configuration for `update_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :update_collector + ## + # RPC-specific configuration for `delete_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_collector + ## + # RPC-specific configuration for `resume_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_collector + ## + # RPC-specific configuration for `register_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :register_collector + ## + # RPC-specific configuration for `pause_collector` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_collector + + # @private + def initialize parent_rpcs = nil + create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector + @create_collector = ::Gapic::Config::Method.new create_collector_config + create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation + @create_annotation = ::Gapic::Config::Method.new create_annotation_config + get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation + @get_annotation = ::Gapic::Config::Method.new get_annotation_config + list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors + @list_collectors = ::Gapic::Config::Method.new list_collectors_config + get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector + @get_collector = ::Gapic::Config::Method.new get_collector_config + update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector + @update_collector = ::Gapic::Config::Method.new update_collector_config + delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector + @delete_collector = ::Gapic::Config::Method.new delete_collector_config + resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector + @resume_collector = ::Gapic::Config::Method.new resume_collector_config + register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector + @register_collector = ::Gapic::Config::Method.new register_collector_config + pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector + @pause_collector = ::Gapic::Config::Method.new pause_collector_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb new file mode 100644 index 000000000000..fd12e4bbf903 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the RapidMigrationAssessment 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 RapidMigrationAssessment 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::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::RapidMigrationAssessment::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "rapidmigrationassessment.googleapis.com" + + config_attr :endpoint, nil, ::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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb new file mode 100644 index 000000000000..4309790cbd20 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + module Rest + ## + # REST service stub for the RapidMigrationAssessment 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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_annotation REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_annotation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_annotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_annotation REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] + # A result object deserialized from the server's reply + def get_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_annotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.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_collectors REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse] + # A result object deserialized from the server's reply + def list_collectors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_collectors_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_collectors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # A result object deserialized from the server's reply + def get_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def resume_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the register_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def register_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_register_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "register_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def pause_collector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_collector_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_collector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest] + # 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_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/collectors", + body: "collector", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_annotation REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest] + # 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_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/annotations", + body: "annotation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_annotation REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_collectors REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_collectors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/collectors", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest] + # 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_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{collector.name}", + body: "collector", + matches: [ + ["collector.name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest] + # 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_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest] + # 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_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the register_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_register_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:register", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_collector REST call + # + # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest] + # 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_collector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb new file mode 100644 index 000000000000..4f296b183c65 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/v1/rapid_migration_assessment/rest" +require "google/cloud/rapid_migration_assessment/v1/bindings_override" +require "google/cloud/rapid_migration_assessment/v1/version" + +module Google + module Cloud + module RapidMigrationAssessment + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/rapid_migration_assessment/v1/rest" + # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb new file mode 100644 index 000000000000..4c6ae2c4276a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb new file mode 100644 index 000000000000..91d68192dc7d --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/rapidmigrationassessment/v1/api_entities.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/rapidmigrationassessment/v1/api_entities.proto\x12(google.cloud.rapidmigrationassessment.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\"\n\x0bGuestOsScan\x12\x13\n\x0b\x63ore_source\x18\x01 \x01(\t\"\"\n\x0bVSphereScan\x12\x13\n\x0b\x63ore_source\x18\x01 \x01(\t\"\xfa\x07\n\tCollector\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12O\n\x06labels\x18\x04 \x03(\x0b\x32?.google.cloud.rapidmigrationassessment.v1.Collector.LabelsEntry\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x17\n\x0fservice_account\x18\x07 \x01(\t\x12\x13\n\x06\x62ucket\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x14\x65xpected_asset_count\x18\t \x01(\x03\x12M\n\x05state\x18\n \x01(\x0e\x32\x39.google.cloud.rapidmigrationassessment.v1.Collector.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x63lient_version\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12Q\n\rguest_os_scan\x18\x0c \x01(\x0b\x32\x35.google.cloud.rapidmigrationassessment.v1.GuestOsScanB\x03\xe0\x41\x03\x12P\n\x0cvsphere_scan\x18\r \x01(\x0b\x32\x35.google.cloud.rapidmigrationassessment.v1.VSphereScanB\x03\xe0\x41\x03\x12\x17\n\x0f\x63ollection_days\x18\x0e \x01(\x05\x12\x10\n\x08\x65ula_uri\x18\x0f \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12STATE_INITIALIZING\x10\x01\x12\x16\n\x12STATE_READY_TO_USE\x10\x02\x12\x14\n\x10STATE_REGISTERED\x10\x03\x12\x10\n\x0cSTATE_ACTIVE\x10\x04\x12\x10\n\x0cSTATE_PAUSED\x10\x05\x12\x12\n\x0eSTATE_DELETING\x10\x06\x12\x18\n\x14STATE_DECOMMISSIONED\x10\x07\x12\x0f\n\x0bSTATE_ERROR\x10\x08:v\xea\x41s\n1rapidmigrationassessment.googleapis.com/Collector\x12>projects/{project}/locations/{location}/collectors/{collector}\"\x9b\x04\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x06labels\x18\x04 \x03(\x0b\x32@.google.cloud.rapidmigrationassessment.v1.Annotation.LabelsEntry\x12G\n\x04type\x18\x05 \x01(\x0e\x32\x39.google.cloud.rapidmigrationassessment.v1.Annotation.Type\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"N\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aTYPE_LEGACY_EXPORT_CONSENT\x10\x01\x12\x10\n\x0cTYPE_QWIKLAB\x10\x02:y\xea\x41v\n2rapidmigrationassessment.googleapis.com/Annotation\x12@projects/{project}/locations/{location}/annotations/{annotation}B\xb0\x02\n,com.google.cloud.rapidmigrationassessment.v1B\x10\x41piEntitiesProtoP\x01Zhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb\xaa\x02(Google.Cloud.RapidMigrationAssessment.V1\xca\x02(Google\\Cloud\\RapidMigrationAssessment\\V1\xea\x02+Google::Cloud::RapidMigrationAssessment::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"], + ] + 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 RapidMigrationAssessment + module V1 + GuestOsScan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GuestOsScan").msgclass + VSphereScan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.VSphereScan").msgclass + Collector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Collector").msgclass + Collector::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Collector.State").enummodule + Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Annotation").msgclass + Annotation::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Annotation.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb new file mode 100644 index 000000000000..31e510321760 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.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/rapidmigrationassessment/v1/api_entities_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nGgoogle/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto\x12(google.cloud.rapidmigrationassessment.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/rapidmigrationassessment/v1/api_entities.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbc\x01\n\x17\x43reateAnnotationRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12M\n\nannotation\x18\x02 \x01(\x0b\x32\x34.google.cloud.rapidmigrationassessment.v1.AnnotationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"`\n\x14GetAnnotationRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2rapidmigrationassessment.googleapis.com/Annotation\"\xd4\x01\n\x16\x43reateCollectorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0c\x63ollector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\tcollector\x18\x03 \x01(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.CollectorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x15ListCollectorsRequest\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\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x8f\x01\n\x16ListCollectorsResponse\x12G\n\ncollectors\x18\x01 \x03(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.Collector\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"^\n\x13GetCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\"z\n\x16\x44\x65leteCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb4\x01\n\x16UpdateCollectorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12K\n\tcollector\x18\x02 \x01(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.CollectorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"z\n\x16ResumeCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"|\n\x18RegisterCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"y\n\x15PauseCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\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\x32\xb7\x12\n\x18RapidMigrationAssessment\x12\xf7\x01\n\x0f\x43reateCollector\x12@.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x1dparent,collector,collector_id\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/collectors:\tcollector\x12\xef\x01\n\x10\x43reateAnnotation\x12\x41.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1f\n\nAnnotation\x12\x11OperationMetadata\xda\x41\x11parent,annotation\x82\xd3\xe4\x93\x02=\"//v1/{parent=projects/*/locations/*}/annotations:\nannotation\x12\xc5\x01\n\rGetAnnotation\x12>.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest\x1a\x34.google.cloud.rapidmigrationassessment.v1.Annotation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/annotations/*}\x12\xd4\x01\n\x0eListCollectors\x12?.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest\x1a@.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/collectors\x12\xc1\x01\n\x0cGetCollector\x12=.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest\x1a\x33.google.cloud.rapidmigrationassessment.v1.Collector\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/collectors/*}\x12\xf9\x01\n\x0fUpdateCollector\x12@.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x15\x63ollector,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v1/{collector.name=projects/*/locations/*/collectors/*}:\tcollector\x12\xd2\x01\n\x0f\x44\x65leteCollector\x12@.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/collectors/*}\x12\xdc\x01\n\x0fResumeCollector\x12@.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/collectors/*}:resume:\x01*\x12\xe2\x01\n\x11RegisterCollector\x12\x42.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/locations/*/collectors/*}:register:\x01*\x12\xd9\x01\n\x0ePauseCollector\x12?.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/collectors/*}:pause:\x01*\x1a[\xca\x41\'rapidmigrationassessment.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbd\x02\n,com.google.cloud.rapidmigrationassessment.v1B\x1dRapidMigrationAssessmentProtoP\x01Zhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb\xaa\x02(Google.Cloud.RapidMigrationAssessment.V1\xca\x02(Google\\Cloud\\RapidMigrationAssessment\\V1\xea\x02+Google::Cloud::RapidMigrationAssessment::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.rapidmigrationassessment.v1.Annotation", "google/cloud/rapidmigrationassessment/v1/api_entities.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 RapidMigrationAssessment + module V1 + CreateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest").msgclass + GetAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest").msgclass + CreateCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest").msgclass + ListCollectorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest").msgclass + ListCollectorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse").msgclass + GetCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GetCollectorRequest").msgclass + DeleteCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest").msgclass + UpdateCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest").msgclass + ResumeCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest").msgclass + RegisterCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest").msgclass + PauseCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb new file mode 100644 index 000000000000..29b1a1c8f0cb --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto for package 'Google.Cloud.RapidMigrationAssessment.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/rapidmigrationassessment/v1/rapidmigrationassessment_pb' + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + module RapidMigrationAssessment + # Service describing handlers for resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' + + # Create a Collector to manage the on-prem appliance which collects + # information about Customer assets. + rpc :CreateCollector, ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Google::Longrunning::Operation + # Creates an Annotation + rpc :CreateAnnotation, ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Google::Longrunning::Operation + # Gets details of a single Annotation. + rpc :GetAnnotation, ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Google::Cloud::RapidMigrationAssessment::V1::Annotation + # Lists Collectors in a given project and location. + rpc :ListCollectors, ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse + # Gets details of a single Collector. + rpc :GetCollector, ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Google::Cloud::RapidMigrationAssessment::V1::Collector + # Updates the parameters of a single Collector. + rpc :UpdateCollector, ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Google::Longrunning::Operation + # Deletes a single Collector - changes state of collector to "Deleting". + # Background jobs does final deletion through producer API. + rpc :DeleteCollector, ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Google::Longrunning::Operation + # Resumes the given collector. + rpc :ResumeCollector, ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Google::Longrunning::Operation + # Registers the given collector. + rpc :RegisterCollector, ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Google::Longrunning::Operation + # Pauses the given collector. + rpc :PauseCollector, ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md new file mode 100644 index 000000000000..ee165a3c3e33 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Rapid Migration Assessment 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-rapid_migration_assessment-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb new file mode 100644 index 000000000000..aed03420ed4e --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.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 RapidMigrationAssessment + module V1 + # Message describing a MC Source of type Guest OS Scan. + # @!attribute [rw] core_source + # @return [::String] + # reference to the corresponding Guest OS Scan in MC Source. + class GuestOsScan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing a MC Source of type VSphere Scan. + # @!attribute [rw] core_source + # @return [::String] + # reference to the corresponding VSphere Scan in MC Source. + class VSphereScan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Collector object. + # @!attribute [rw] name + # @return [::String] + # name of resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] display_name + # @return [::String] + # User specified name of the Collector. + # @!attribute [rw] description + # @return [::String] + # User specified description of the Collector. + # @!attribute [rw] service_account + # @return [::String] + # Service Account email used to ingest data to this Collector. + # @!attribute [r] bucket + # @return [::String] + # Output only. Store cloud storage bucket name (which is a guid) created with + # this Collector. + # @!attribute [rw] expected_asset_count + # @return [::Integer] + # User specified expected asset count. + # @!attribute [r] state + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector::State] + # Output only. State of the Collector. + # @!attribute [r] client_version + # @return [::String] + # Output only. Client version. + # @!attribute [r] guest_os_scan + # @return [::Google::Cloud::RapidMigrationAssessment::V1::GuestOsScan] + # Output only. Reference to MC Source Guest Os Scan. + # @!attribute [r] vsphere_scan + # @return [::Google::Cloud::RapidMigrationAssessment::V1::VSphereScan] + # Output only. Reference to MC Source vsphere_scan. + # @!attribute [rw] collection_days + # @return [::Integer] + # How many days to collect data. + # @!attribute [rw] eula_uri + # @return [::String] + # Uri for EULA (End User License Agreement) from customer. + class Collector + 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 + + # -- Using suggestion from API Linter Analyzer for nesting enum -- + # -- https://linter.aip.dev/216/nesting -- + # State of a Collector (server_side). + # States are used for internal purposes and named to keep + # convention of legacy product: + # https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe. + module State + # Collector state is not recognized. + STATE_UNSPECIFIED = 0 + + # Collector started to create, but hasn't been completed MC source creation + # and db object creation. + STATE_INITIALIZING = 1 + + # Collector has been created, MC source creation and db object creation + # completed. + STATE_READY_TO_USE = 2 + + # Collector client has been registered with client. + STATE_REGISTERED = 3 + + # Collector client is actively scanning. + STATE_ACTIVE = 4 + + # Collector is not actively scanning. + STATE_PAUSED = 5 + + # Collector is starting background job for deletion. + STATE_DELETING = 6 + + # Collector completed all tasks for deletion. + STATE_DECOMMISSIONED = 7 + + # Collector is in error state. + STATE_ERROR = 8 + end + end + + # Message describing an Annotation + # @!attribute [rw] name + # @return [::String] + # name of resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] type + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation::Type] + # Type of an annotation. + class Annotation + 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 + + # Types for project level setting. + module Type + # Unknown type + TYPE_UNSPECIFIED = 0 + + # Indicates that this project has opted into StratoZone export. + TYPE_LEGACY_EXPORT_CONSENT = 1 + + # Indicates that this project is created by Qwiklab. + TYPE_QWIKLAB = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb new file mode 100644 index 000000000000..a2b299a0f1d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb @@ -0,0 +1,272 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RapidMigrationAssessment + module V1 + # Message for creating an AnnotationS. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent (project+location). + # @!attribute [rw] annotation + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. + class CreateAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a specific Annotation + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Collector. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent (project+location). + # @!attribute [rw] collector_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] collector + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. + class CreateCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Collectors. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListCollectorsRequest. + # @!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] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListCollectorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Collectors. + # @!attribute [rw] collectors + # @return [::Array<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] + # The list of Collectors. + # @!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 ListCollectorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a specific Collector. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Collector. + # @!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 DeleteCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Collector. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Collector 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] collector + # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] + # Required. The resource being updated. + # @!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 UpdateCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for resuming a Collector. + # @!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 ResumeCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for registering a Collector. + # @!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 RegisterCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for pausing a Collector. + # @!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 PauseCollectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/Gemfile new file mode 100644 index 000000000000..2884289a7883 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1", path: "../" +else + gem "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb new file mode 100644 index 000000000000..4984dff6d462 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the create_annotation call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation. +# +def create_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new + + # Call the create_annotation method. + result = client.create_annotation request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb new file mode 100644 index 000000000000..882556aa673b --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the create_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector. +# +def create_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new + + # Call the create_collector method. + result = client.create_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb new file mode 100644 index 000000000000..5eb78f44fb79 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the delete_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector. +# +def delete_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new + + # Call the delete_collector method. + result = client.delete_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb new file mode 100644 index 000000000000..9f527cffba71 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the get_annotation call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation. +# +def get_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new + + # Call the get_annotation method. + result = client.get_annotation request + + # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. + p result +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb new file mode 100644 index 000000000000..d233ac84a69a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the get_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector. +# +def get_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new + + # Call the get_collector method. + result = client.get_collector request + + # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. + p result +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb new file mode 100644 index 000000000000..99b9954c3d10 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the list_collectors call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors. +# +def list_collectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new + + # Call the list_collectors method. + result = client.list_collectors request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. + p item + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb new file mode 100644 index 000000000000..f248a1b4c0fe --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the pause_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector. +# +def pause_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new + + # Call the pause_collector method. + result = client.pause_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb new file mode 100644 index 000000000000..e4214e5472e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the register_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector. +# +def register_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new + + # Call the register_collector method. + result = client.register_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb new file mode 100644 index 000000000000..a2885af3fc14 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the resume_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector. +# +def resume_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new + + # Call the resume_collector method. + result = client.resume_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb new file mode 100644 index 000000000000..83eec5feb472 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] +require "google/cloud/rapid_migration_assessment/v1" + +## +# Snippet for the update_collector call in the RapidMigrationAssessment service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector. +# +def update_collector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new + + # Call the update_collector method. + result = client.update_collector request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json new file mode 100644 index 000000000000..160c42b58912 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json @@ -0,0 +1,415 @@ +{ + "client_library": { + "name": "google-cloud-rapid_migration_assessment-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.rapidmigrationassessment.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync", + "title": "Snippet for the create_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector.", + "file": "rapid_migration_assessment/create_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "CreateCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync", + "title": "Snippet for the create_annotation call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation.", + "file": "rapid_migration_assessment/create_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_annotation", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "CreateAnnotation", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotation", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync", + "title": "Snippet for the get_annotation call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation.", + "file": "rapid_migration_assessment/get_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_annotation", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::Annotation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "GetAnnotation", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotation", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync", + "title": "Snippet for the list_collectors call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors.", + "file": "rapid_migration_assessment/list_collectors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_collectors", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "ListCollectors", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectors", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync", + "title": "Snippet for the get_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector.", + "file": "rapid_migration_assessment/get_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::Collector", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "GetCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync", + "title": "Snippet for the update_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector.", + "file": "rapid_migration_assessment/update_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "UpdateCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync", + "title": "Snippet for the delete_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector.", + "file": "rapid_migration_assessment/delete_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "DeleteCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync", + "title": "Snippet for the resume_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector.", + "file": "rapid_migration_assessment/resume_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "ResumeCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync", + "title": "Snippet for the register_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector.", + "file": "rapid_migration_assessment/register_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "register_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "RegisterCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync", + "title": "Snippet for the pause_collector call in the RapidMigrationAssessment service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector.", + "file": "rapid_migration_assessment/pause_collector.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_collector", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "RapidMigrationAssessment::Client", + "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" + }, + "method": { + "short_name": "PauseCollector", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollector", + "service": { + "short_name": "RapidMigrationAssessment", + "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" + } + } + }, + "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-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb new file mode 100644 index 000000000000..58907452501b --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" +require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" + +class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb new file mode 100644 index 000000000000..b87222a2b1a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_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/rapid_migration_assessment/v1/rapid_migration_assessment" + +class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_annotation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.annotation_path project: "value0", location: "value1", annotation: "value2" + assert_equal "projects/value0/locations/value1/annotations/value2", path + end + end + + def test_collector_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.collector_path project: "value0", location: "value1", collector: "value2" + assert_equal "projects/value0/locations/value1/collectors/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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb new file mode 100644 index 000000000000..7d3fad47b643 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb @@ -0,0 +1,654 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" + + +class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector + # Create test objects. + 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" + collector_id = "hello world" + collector = {} + request_id = "hello world" + + create_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_create_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_collector parent: parent, collector_id: collector_id, collector: collector, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_collector ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_collector(::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_collector_client_stub.call_count + end + end + end + + def test_create_annotation + # Create test objects. + 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" + annotation = {} + request_id = "hello world" + + create_annotation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_create_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_annotation_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_annotation({ parent: parent, annotation: annotation, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_annotation parent: parent, annotation: annotation, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_annotation ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_annotation({ parent: parent, annotation: annotation, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_annotation(::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_annotation_client_stub.call_count + end + end + end + + def test_get_annotation + # Create test objects. + client_result = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_annotation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_get_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_annotation_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_annotation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_annotation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_annotation ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_annotation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_annotation(::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_annotation_client_stub.call_count + end + end + end + + def test_list_collectors + # Create test objects. + client_result = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.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_collectors_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_list_collectors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_collectors_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_collectors({ 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_collectors 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_collectors ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors({ 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_collectors(::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors_client_stub.call_count + end + end + end + + def test_get_collector + # Create test objects. + client_result = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_get_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_collector({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_collector name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_collector ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_collector({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_collector(::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_collector_client_stub.call_count + end + end + end + + def test_update_collector + # Create test objects. + 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 = {} + collector = {} + request_id = "hello world" + + update_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_update_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_collector({ update_mask: update_mask, collector: collector, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_collector update_mask: update_mask, collector: collector, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_collector ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_collector({ update_mask: update_mask, collector: collector, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_collector(::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_collector_client_stub.call_count + end + end + end + + def test_delete_collector + # Create test objects. + 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_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_delete_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_collector({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_collector name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_collector ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector({ 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector_client_stub.call_count + end + end + end + + def test_resume_collector + # Create test objects. + 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" + + resume_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_resume_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_collector({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_collector name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_collector ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_collector({ 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.resume_collector(::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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, resume_collector_client_stub.call_count + end + end + end + + def test_register_collector + # Create test objects. + 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" + + register_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_register_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, register_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.register_collector({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.register_collector name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.register_collector ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.register_collector({ 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.register_collector(::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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, register_collector_client_stub.call_count + end + end + end + + def test_pause_collector + # Create test objects. + 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" + + pause_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_pause_collector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_collector({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_collector name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_collector ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_collector({ 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.pause_collector(::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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, pause_collector_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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb new file mode 100644 index 000000000000..f267aeb2fd60 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb @@ -0,0 +1,768 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" +require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" + +class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + collector_id = "hello world" + collector = {} + request_id = "hello world" + + create_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["collector_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Collector), request["collector"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, 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_collector parent: parent, collector_id: collector_id, collector: collector, 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, 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_collector({ parent: parent, collector_id: collector_id, collector: collector, 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, 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_collector_client_stub.call_rpc_count + end + end + + def test_create_annotation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + annotation = {} + request_id = "hello world" + + create_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_annotation, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Annotation), request["annotation"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_annotation_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_annotation({ parent: parent, annotation: annotation, 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_annotation parent: parent, annotation: annotation, 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_annotation ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, 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_annotation({ parent: parent, annotation: annotation, 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_annotation(::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, 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_annotation_client_stub.call_rpc_count + end + end + + def test_get_annotation + # Create GRPC objects. + grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_annotation, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_annotation_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_annotation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_annotation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_annotation ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_annotation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_annotation(::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_annotation_client_stub.call_rpc_count + end + end + + def test_list_collectors + # Create GRPC objects. + grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_collectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_collectors, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, 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_collectors_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_collectors({ 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_collectors 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_collectors ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors({ 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_collectors(::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors_client_stub.call_rpc_count + end + end + + def test_get_collector + # Create GRPC objects. + grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_collector({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_collector name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_collector ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_collector({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_collector(::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_collector_client_stub.call_rpc_count + end + end + + def test_update_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + collector = {} + request_id = "hello world" + + update_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Collector), request["collector"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_collector({ update_mask: update_mask, collector: collector, 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_collector update_mask: update_mask, collector: collector, 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, 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_collector({ update_mask: update_mask, collector: collector, 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, 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_collector_client_stub.call_rpc_count + end + end + + def test_delete_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_collector({ 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_collector 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector({ 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector_client_stub.call_rpc_count + end + end + + def test_resume_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + resume_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_collector({ 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.resume_collector 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.resume_collector ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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.resume_collector({ 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.resume_collector(::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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, resume_collector_client_stub.call_rpc_count + end + end + + def test_register_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + register_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :register_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, register_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.register_collector({ 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.register_collector 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.register_collector ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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.register_collector({ 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.register_collector(::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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, register_collector_client_stub.call_rpc_count + end + end + + def test_pause_collector + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + pause_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_collector, name + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_collector_client_stub do + # Create client + client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_collector({ 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.pause_collector 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.pause_collector ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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.pause_collector({ 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.pause_collector(::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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, pause_collector_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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment/.gitignore b/owl-bot-staging/google-cloud-rapid_migration_assessment/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/.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-rapid_migration_assessment/.repo-metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json new file mode 100644 index 000000000000..b1587db22543 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "rapidmigrationassessment.googleapis.com", + "api_shortname": "rapidmigrationassessment", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment/latest", + "distribution_name": "google-cloud-rapid_migration_assessment", + "is_cloud": true, + "language": "ruby", + "name": "rapidmigrationassessment", + "name_pretty": "Rapid Migration Assessment API", + "product_documentation": "https://cloud.google.com/migration-center/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Rapid Migration Assessment service is our first-party migration assessment and planning tool.", + "ruby-cloud-product-url": "https://cloud.google.com/migration-center/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml b/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml new file mode 100644 index 000000000000..d4a47aeea4fa --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-rapid_migration_assessment.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-rapid_migration_assessment.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/.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-rapid_migration_assessment/.yardopts b/owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts new file mode 100644 index 000000000000..1fcbd04b5c20 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Rapid Migration Assessment 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-rapid_migration_assessment/AUTHENTICATION.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md new file mode 100644 index 000000000000..90c88f61aadb --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-rapid_migration_assessment 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-rapid_migration_assessment 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/rapid_migration_assessment" + +client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/rapid_migration_assessment" + +Google::Cloud::RapidMigrationAssessment.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment +``` + +### 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-rapid_migration_assessment +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/rapid_migration_assessment" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment +``` + +### 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-rapid_migration_assessment/CHANGELOG.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile new file mode 100644 index 000000000000..443e9209c0ed --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-rapid_migration_assessment-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-rapid_migration_assessment.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-rapid_migration_assessment/LICENSE.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/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-rapid_migration_assessment/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/README.md new file mode 100644 index 000000000000..6cfd314394b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Rapid Migration Assessment API + +The Rapid Migration Assessment service is our first-party migration assessment and planning tool. + +The Rapid Migration Assessment service is our first-party migration assessment and planning tool. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-rapid_migration_assessment-v*`. +The gem `google-cloud-rapid_migration_assessment` 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-rapid_migration_assessment/latest) +for this library, google-cloud-rapid_migration_assessment, 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-rapid_migration_assessment-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/migration-center/docs) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-rapid_migration_assessment +``` + +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/rapidmigrationassessment.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/rapid_migration_assessment" + +client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment +request = ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new # (request fields as keyword arguments...) +response = client.create_collector 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-rapid_migration_assessment-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`. +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-rapid_migration_assessment-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-rapid_migration_assessment/Rakefile b/owl-bot-staging/google-cloud-rapid_migration_assessment/Rakefile new file mode 100644 index 000000000000..a4f6110ae221 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/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-rapid_migration_assessment 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/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" + ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-rapid_migration_assessment" + header "google-cloud-rapid_migration_assessment rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-rapid_migration_assessment yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec b/owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec new file mode 100644 index 000000000000..d96fcb198783 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/rapid_migration_assessment/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-rapid_migration_assessment" + gem.version = Google::Cloud::RapidMigrationAssessment::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." + gem.summary = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." + 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-rapid_migration_assessment-v1", "~> 2.0" +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb new file mode 100644 index 000000000000..e24e54ee8658 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.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/rapid_migration_assessment" unless defined? Google::Cloud::RapidMigrationAssessment::VERSION diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb new file mode 100644 index 000000000000..defccdc5bf20 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/rapid_migration_assessment/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! :rapid_migration_assessment 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 RapidMigrationAssessment + ## + # Create a new client object for RapidMigrationAssessment. + # + # By default, this returns an instance of + # [Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest/Google-Cloud-RapidMigrationAssessment-V1-RapidMigrationAssessment-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 RapidMigrationAssessment 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 RapidMigrationAssessment service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_available?}. + # + # ## About RapidMigrationAssessment + # + # Service describing handlers for resources. + # + # @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.rapid_migration_assessment version: :v1, transport: :grpc, &block + require "google/cloud/rapid_migration_assessment/#{version.to_s.downcase}" + + package_name = Google::Cloud::RapidMigrationAssessment + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RapidMigrationAssessment.const_get(package_name).const_get(:RapidMigrationAssessment) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the RapidMigrationAssessment service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the RapidMigrationAssessment service, + # or if the versioned client gem needs an update to support the RapidMigrationAssessment 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.rapid_migration_assessment_available? version: :v1, transport: :grpc + require "google/cloud/rapid_migration_assessment/#{version.to_s.downcase}" + package_name = Google::Cloud::RapidMigrationAssessment + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RapidMigrationAssessment.const_get package_name + return false unless service_module.const_defined? :RapidMigrationAssessment + service_module = service_module.const_get :RapidMigrationAssessment + 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-rapid_migration_assessment 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.rapid_migration_assessment if block_given? + + ::Google::Cloud.configure.rapid_migration_assessment + end + end + end +end + +helper_path = ::File.join __dir__, "rapid_migration_assessment", "helpers.rb" +require "google/cloud/rapid_migration_assessment/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb new file mode 100644 index 000000000000..8be3c821a1fd --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb new file mode 100644 index 000000000000..705fb490d739 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::RapidMigrationAssessment::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_rapid_migration_assessment_grpc + skip unless Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_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::RapidMigrationAssessment.rapid_migration_assessment transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client, client + end + end + + def test_rapid_migration_assessment_rest + skip unless Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb new file mode 100644 index 000000000000..61766b818718 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/version" + +class Google::Cloud::RapidMigrationAssessment::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::RapidMigrationAssessment::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-rapid_migration_assessment/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-recaptcha_enterprise-v1/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json new file mode 100644 index 000000000000..3e4db3422126 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recaptchaenterprise.googleapis.com", + "api_shortname": "recaptchaenterprise", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest", + "distribution_name": "google-cloud-recaptcha_enterprise-v1", + "is_cloud": true, + "language": "ruby", + "name": "recaptchaenterprise", + "name_pretty": "reCAPTCHA Enterprise V1 API", + "product_documentation": "https://cloud.google.com/recaptcha-enterprise", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", + "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml new file mode 100644 index 000000000000..8ef5ef06ddf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts new file mode 100644 index 000000000000..b645b56b6f54 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="reCAPTCHA Enterprise 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-recaptcha_enterprise-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..5c2af6e5e391 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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/recaptcha_enterprise/v1" + +client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recaptcha_enterprise/v1" + +::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise-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/recaptcha_enterprise/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md new file mode 100644 index 000000000000..6510d87e0136 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the reCAPTCHA Enterprise V1 API + +Help protect your website from fraudulent activity, spam, and abuse without creating friction. + +reCAPTCHA Enterprise is a service that protects your site from spam and abuse. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the reCAPTCHA Enterprise V1 API. Most users should consider using +the main client gem, +[google-cloud-recaptcha_enterprise](https://rubygems.org/gems/google-cloud-recaptcha_enterprise). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-recaptcha_enterprise-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/recaptchaenterprise.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/recaptcha_enterprise/v1" + +client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +request = ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new # (request fields as keyword arguments...) +response = client.create_assessment request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) +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/recaptcha_enterprise/v1" +require "logger" + +client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. +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-recaptcha_enterprise-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-recaptcha_enterprise-v1/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Rakefile new file mode 100644 index 000000000000..5d19c638aa73 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" + ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recaptcha_enterprise-v1" + header "google-cloud-recaptcha_enterprise-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recaptcha_enterprise-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json new file mode 100644 index 000000000000..401c9dadcea7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.recaptchaenterprise.v1", + "libraryPackage": "::Google::Cloud::RecaptchaEnterprise::V1", + "services": { + "RecaptchaEnterpriseService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client", + "rpcs": { + "CreateAssessment": { + "methods": [ + "create_assessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotate_assessment" + ] + }, + "CreateKey": { + "methods": [ + "create_key" + ] + }, + "ListKeys": { + "methods": [ + "list_keys" + ] + }, + "RetrieveLegacySecretKey": { + "methods": [ + "retrieve_legacy_secret_key" + ] + }, + "GetKey": { + "methods": [ + "get_key" + ] + }, + "UpdateKey": { + "methods": [ + "update_key" + ] + }, + "DeleteKey": { + "methods": [ + "delete_key" + ] + }, + "MigrateKey": { + "methods": [ + "migrate_key" + ] + }, + "AddIpOverride": { + "methods": [ + "add_ip_override" + ] + }, + "RemoveIpOverride": { + "methods": [ + "remove_ip_override" + ] + }, + "ListIpOverrides": { + "methods": [ + "list_ip_overrides" + ] + }, + "GetMetrics": { + "methods": [ + "get_metrics" + ] + }, + "CreateFirewallPolicy": { + "methods": [ + "create_firewall_policy" + ] + }, + "ListFirewallPolicies": { + "methods": [ + "list_firewall_policies" + ] + }, + "GetFirewallPolicy": { + "methods": [ + "get_firewall_policy" + ] + }, + "UpdateFirewallPolicy": { + "methods": [ + "update_firewall_policy" + ] + }, + "DeleteFirewallPolicy": { + "methods": [ + "delete_firewall_policy" + ] + }, + "ReorderFirewallPolicies": { + "methods": [ + "reorder_firewall_policies" + ] + }, + "ListRelatedAccountGroups": { + "methods": [ + "list_related_account_groups" + ] + }, + "ListRelatedAccountGroupMemberships": { + "methods": [ + "list_related_account_group_memberships" + ] + }, + "SearchRelatedAccountGroupMemberships": { + "methods": [ + "search_related_account_group_memberships" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec new file mode 100644 index 000000000000..236873440b9e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recaptcha_enterprise/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recaptcha_enterprise-v1" + gem.version = Google::Cloud::RecaptchaEnterprise::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details." + gem.summary = "Help protect your website from fraudulent activity, spam, and abuse without creating friction." + 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-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb new file mode 100644 index 000000000000..709bd158bdb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-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/recaptcha_enterprise/v1" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb new file mode 100644 index 000000000000..c0a5bb548e00 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.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/recaptcha_enterprise/v1/recaptcha_enterprise_service" +require "google/cloud/recaptcha_enterprise/v1/version" + +module Google + module Cloud + module RecaptchaEnterprise + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/recaptcha_enterprise/v1" + # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/recaptcha_enterprise/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb new file mode 100644 index 000000000000..2bbbe6309445 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.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 "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/recaptcha_enterprise/v1/version" + +require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" +require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths" +require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client" + +module Google + module Cloud + module RecaptchaEnterprise + module V1 + ## + # Service to determine the likelihood an event is legitimate. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service" + # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + module RecaptchaEnterpriseService + end + end + end + end +end + +helper_path = ::File.join __dir__, "recaptcha_enterprise_service", "helpers.rb" +require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb new file mode 100644 index 000000000000..81cd812def23 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb @@ -0,0 +1,2609 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb" + +module Google + module Cloud + module RecaptchaEnterprise + module V1 + module RecaptchaEnterpriseService + ## + # Client for the RecaptchaEnterpriseService service. + # + # Service to determine the likelihood an event is legitimate. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recaptcha_enterprise_service_stub + + ## + # Configure the RecaptchaEnterpriseService Client class. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecaptchaEnterpriseService clients + # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RecaptchaEnterprise", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_assessment.timeout = 600.0 + + default_config.rpcs.annotate_assessment.timeout = 600.0 + + default_config.rpcs.create_key.timeout = 600.0 + + default_config.rpcs.list_keys.timeout = 600.0 + + default_config.rpcs.get_key.timeout = 600.0 + + default_config.rpcs.update_key.timeout = 600.0 + + default_config.rpcs.delete_key.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecaptchaEnterpriseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recaptcha_enterprise_service_stub.universe_domain + end + + ## + # Create a new RecaptchaEnterpriseService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecaptchaEnterpriseService 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/recaptchaenterprise/v1/recaptchaenterprise_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 + + @recaptcha_enterprise_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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 + ) + + @recaptcha_enterprise_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @recaptcha_enterprise_service_stub.logger + end + + # Service calls + + ## + # Creates an Assessment of the likelihood an event is legitimate. + # + # @overload create_assessment(request, options = nil) + # Pass arguments to `create_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_assessment(parent: nil, assessment: nil) + # Pass arguments to `create_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 project in which the assessment is created, + # in the format `projects/{project}`. + # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1::Assessment, ::Hash] + # Required. The assessment details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new + # + # # Call the create_assessment method. + # result = client.create_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. + # p result + # + def create_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest + + # Converts hash and nil to 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_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_assessment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Annotates a previously created Assessment to provide additional information + # on whether the event turned out to be authentic or fraudulent. + # + # @overload annotate_assessment(request, options = nil) + # Pass arguments to `annotate_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, account_id: nil, hashed_account_id: nil, transaction_event: nil, phone_authentication_event: nil) + # Pass arguments to `annotate_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Assessment, in the format + # `projects/{project}/assessments/{assessment}`. + # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation] + # Optional. The annotation that is assigned to the Event. This field can be + # left empty to provide reasons that apply to an event without concluding + # whether the event is legitimate or fraudulent. + # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>] + # Optional. Reasons for the annotation that are assigned to the event. + # @param account_id [::String] + # Optional. A stable account identifier to apply to the assessment. This is + # an alternative to setting `account_id` in `CreateAssessment`, for example + # when a stable account identifier is not yet known in the initial request. + # @param hashed_account_id [::String] + # Optional. A stable hashed account identifier to apply to the assessment. + # This is an alternative to setting `hashed_account_id` in + # `CreateAssessment`, for example when a stable account identifier is not yet + # known in the initial request. + # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent, ::Hash] + # Optional. If the assessment is part of a payment transaction, provide + # details on payment lifecycle events that occur in the transaction. + # @param phone_authentication_event [::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent, ::Hash] + # Optional. If using an external multi-factor authentication provider, + # provide phone authentication details for fraud detection purposes. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new + # + # # Call the annotate_assessment method. + # result = client.annotate_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. + # p result + # + def annotate_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.annotate_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.annotate_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, 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 reCAPTCHA Enterprise key. + # + # @overload create_key(request, options = nil) + # Pass arguments to `create_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_key(parent: nil, key: nil) + # Pass arguments to `create_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project in which the key is created, in the + # format `projects/{project}`. + # @param key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash] + # Required. Information to create a reCAPTCHA Enterprise key. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new + # + # # Call the create_key method. + # result = client.create_key request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + # p result + # + def create_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest + + # Converts hash and nil to 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_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :create_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 + + ## + # Returns the list of all keys that belong to a project. + # + # @overload list_keys(request, options = nil) + # Pass arguments to `list_keys` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_keys(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_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 name of the project that contains the keys that is + # listed, in the format `projects/{project}`. + # @param page_size [::Integer] + # Optional. The maximum number of keys to return. Default is 10. Max limit is + # 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous. + # ListKeysRequest, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new + # + # # Call the list_keys method. + # result = client.list_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::RecaptchaEnterprise::V1::Key. + # p item + # end + # + def list_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_keys.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_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 + + ## + # Returns the secret key related to the specified public key. + # You must use the legacy secret key only in a 3rd party integration with + # legacy reCAPTCHA. + # + # @overload retrieve_legacy_secret_key(request, options = nil) + # Pass arguments to `retrieve_legacy_secret_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload retrieve_legacy_secret_key(key: nil) + # Pass arguments to `retrieve_legacy_secret_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 key [::String] + # Required. The public key name linked to the requested secret key in the + # format `projects/{project}/keys/{key}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new + # + # # Call the retrieve_legacy_secret_key method. + # result = client.retrieve_legacy_secret_key request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. + # p result + # + def retrieve_legacy_secret_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.retrieve_legacy_secret_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.key + header_params["key"] = request.key + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.retrieve_legacy_secret_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.retrieve_legacy_secret_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :retrieve_legacy_secret_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 + + ## + # Returns the specified key. + # + # @overload get_key(request, options = nil) + # Pass arguments to `get_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_key(name: nil) + # Pass arguments to `get_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 name of the requested key, in the format + # `projects/{project}/keys/{key}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new + # + # # Call the get_key method. + # result = client.get_key request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + # p result + # + def get_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :get_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 + + ## + # Updates the specified key. + # + # @overload update_key(request, options = nil) + # Pass arguments to `update_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_key(key: nil, update_mask: nil) + # Pass arguments to `update_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 key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash] + # Required. The key to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields of the key get updated. If the + # mask is not present, all fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new + # + # # Call the update_key method. + # result = client.update_key request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + # p result + # + def update_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest + + # Converts hash and nil to 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_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.key&.name + header_params["key.name"] = request.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_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :update_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 + + ## + # Deletes the specified key. + # + # @overload delete_key(request, options = nil) + # Pass arguments to `delete_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_key(name: nil) + # Pass arguments to `delete_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 name of the key to be deleted, in the format + # `projects/{project}/keys/{key}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new + # + # # Call the delete_key method. + # result = client.delete_key request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :delete_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 + + ## + # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + # Once a key is migrated, it can be used from either product. SiteVerify + # requests are billed as CreateAssessment calls. You must be + # authenticated as one of the current owners of the reCAPTCHA Key, and + # your user must have the reCAPTCHA Enterprise Admin IAM role in the + # destination project. + # + # @overload migrate_key(request, options = nil) + # Pass arguments to `migrate_key` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload migrate_key(name: nil, skip_billing_check: nil) + # Pass arguments to `migrate_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 name of the key to be migrated, in the format + # `projects/{project}/keys/{key}`. + # @param skip_billing_check [::Boolean] + # Optional. If true, skips the billing check. + # A reCAPTCHA Enterprise key or migrated key behaves differently than a + # reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + # https://docs.cloud.google.com/recaptcha/quotas#quota_limit). To avoid + # any disruption of your usage, we check that a billing account is present. + # If your usage of reCAPTCHA is under the free quota, you can safely skip the + # billing check and proceed with the migration. See + # https://cloud.google.com/recaptcha/docs/billing-information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new + # + # # Call the migrate_key method. + # result = client.migrate_key request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + # p result + # + def migrate_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.migrate_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.migrate_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.migrate_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :migrate_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 + + ## + # Adds an IP override to a key. The following restrictions hold: + # * The maximum number of IP overrides per key is 1000. + # * For any conflict (such as IP already exists or IP part of an existing + # IP range), an error is returned. + # + # @overload add_ip_override(request, options = nil) + # Pass arguments to `add_ip_override` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ip_override(name: nil, ip_override_data: nil) + # Pass arguments to `add_ip_override` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 key to which the IP override is added, in the + # format `projects/{project}/keys/{key}`. + # @param ip_override_data [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData, ::Hash] + # Required. IP override added to the key. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new + # + # # Call the add_ip_override method. + # result = client.add_ip_override request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse. + # p result + # + def add_ip_override request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest + + # Converts hash and nil to 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_ip_override.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_ip_override.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_ip_override.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :add_ip_override, request, 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 an IP override from a key. The following restrictions hold: + # * If the IP isn't found in an existing IP override, a `NOT_FOUND` error + # is returned. + # * If the IP is found in an existing IP override, but the + # override type does not match, a `NOT_FOUND` error is returned. + # + # @overload remove_ip_override(request, options = nil) + # Pass arguments to `remove_ip_override` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_ip_override(name: nil, ip_override_data: nil) + # Pass arguments to `remove_ip_override` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 key from which the IP override is removed, in the + # format `projects/{project}/keys/{key}`. + # @param ip_override_data [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData, ::Hash] + # Required. IP override to be removed from the key. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new + # + # # Call the remove_ip_override method. + # result = client.remove_ip_override request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse. + # p result + # + def remove_ip_override request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest + + # Converts hash and nil to 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_ip_override.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_ip_override.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_ip_override.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :remove_ip_override, request, 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 IP overrides for a key. + # + # @overload list_ip_overrides(request, options = nil) + # Pass arguments to `list_ip_overrides` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_ip_overrides(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_ip_overrides` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 key for which the IP overrides are listed, in the + # format `projects/{project}/keys/{key}`. + # @param page_size [::Integer] + # Optional. The maximum number of overrides to return. Default is 10. Max + # limit is 100. If the number of overrides is less than the page_size, all + # overrides are returned. If the page size is more than 100, it is coerced to + # 100. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous + # ListIpOverridesRequest, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.new + # + # # Call the list_ip_overrides method. + # result = client.list_ip_overrides request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData. + # p item + # end + # + def list_ip_overrides request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_ip_overrides.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_ip_overrides.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_ip_overrides.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :list_ip_overrides, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_ip_overrides, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get some aggregated metrics for a Key. This data can be used to build + # dashboards. + # + # @overload get_metrics(request, options = nil) + # Pass arguments to `get_metrics` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_metrics(name: nil) + # Pass arguments to `get_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 name [::String] + # Required. The name of the requested metrics, in the format + # `projects/{project}/keys/{key}/metrics`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Metrics] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Metrics] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new + # + # # Call the get_metrics method. + # result = client.get_metrics request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. + # p result + # + def get_metrics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_metrics.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_metrics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :get_metrics, request, 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 FirewallPolicy, specifying conditions at which reCAPTCHA + # Enterprise actions can be executed. + # A project may have a maximum of 1000 policies. + # + # @overload create_firewall_policy(request, options = nil) + # Pass arguments to `create_firewall_policy` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_firewall_policy(parent: nil, firewall_policy: nil) + # Pass arguments to `create_firewall_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project this policy applies to, in the format + # `projects/{project}`. + # @param firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash] + # Required. Information to create the policy. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new + # + # # Call the create_firewall_policy method. + # result = client.create_firewall_policy request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + # p result + # + def create_firewall_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest + + # Converts hash and nil to 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_firewall_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_firewall_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_firewall_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :create_firewall_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 list of all firewall policies that belong to a project. + # + # @overload list_firewall_policies(request, options = nil) + # Pass arguments to `list_firewall_policies` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_firewall_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_firewall_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project to list the policies for, in the format + # `projects/{project}`. + # @param page_size [::Integer] + # Optional. The maximum number of policies to return. Default is 10. Max + # limit is 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous. + # ListFirewallPoliciesRequest, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.new + # + # # Call the list_firewall_policies method. + # result = client.list_firewall_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + # p item + # end + # + def list_firewall_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_firewall_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_firewall_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_firewall_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :list_firewall_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_firewall_policies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified firewall policy. + # + # @overload get_firewall_policy(request, options = nil) + # Pass arguments to `get_firewall_policy` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_firewall_policy(name: nil) + # Pass arguments to `get_firewall_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the requested policy, in the format + # `projects/{project}/firewallpolicies/{firewallpolicy}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new + # + # # Call the get_firewall_policy method. + # result = client.get_firewall_policy request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + # p result + # + def get_firewall_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_firewall_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_firewall_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_firewall_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :get_firewall_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified firewall policy. + # + # @overload update_firewall_policy(request, options = nil) + # Pass arguments to `update_firewall_policy` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_firewall_policy(firewall_policy: nil, update_mask: nil) + # Pass arguments to `update_firewall_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 firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash] + # Required. The policy to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields of the policy get updated. If + # the mask is not present, all fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new + # + # # Call the update_firewall_policy method. + # result = client.update_firewall_policy request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + # p result + # + def update_firewall_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest + + # Converts hash and nil to 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_firewall_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.firewall_policy&.name + header_params["firewall_policy.name"] = request.firewall_policy.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_firewall_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_firewall_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :update_firewall_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 + + ## + # Deletes the specified firewall policy. + # + # @overload delete_firewall_policy(request, options = nil) + # Pass arguments to `delete_firewall_policy` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_firewall_policy(name: nil) + # Pass arguments to `delete_firewall_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy to be deleted, in the format + # `projects/{project}/firewallpolicies/{firewallpolicy}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new + # + # # Call the delete_firewall_policy method. + # result = client.delete_firewall_policy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_firewall_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_firewall_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::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_firewall_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_firewall_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :delete_firewall_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 + + ## + # Reorders all firewall policies. + # + # @overload reorder_firewall_policies(request, options = nil) + # Pass arguments to `reorder_firewall_policies` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reorder_firewall_policies(parent: nil, names: nil) + # Pass arguments to `reorder_firewall_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project to list the policies for, in the format + # `projects/{project}`. + # @param names [::Array<::String>] + # Required. A list containing all policy names, in the new order. Each name + # is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new + # + # # Call the reorder_firewall_policies method. + # result = client.reorder_firewall_policies request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse. + # p result + # + def reorder_firewall_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reorder_firewall_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reorder_firewall_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reorder_firewall_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :reorder_firewall_policies, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List groups of related accounts. + # + # @overload list_related_account_groups(request, options = nil) + # Pass arguments to `list_related_account_groups` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_related_account_groups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_related_account_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 project to list related account groups from, in + # the format `projects/{project}`. + # @param page_size [::Integer] + # Optional. The maximum number of groups to return. The service might return + # fewer than this value. If unspecified, at most 50 groups are returned. The + # maximum value is 1000; values above 1000 are coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListRelatedAccountGroups` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListRelatedAccountGroups` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new + # + # # Call the list_related_account_groups method. + # result = client.list_related_account_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. + # p item + # end + # + def list_related_account_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_related_account_groups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_related_account_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_related_account_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :list_related_account_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_groups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get memberships in a group of related accounts. + # + # @overload list_related_account_group_memberships(request, options = nil) + # Pass arguments to `list_related_account_group_memberships` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_related_account_group_memberships(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_related_account_group_memberships` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name for the related account group in the format + # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + # @param page_size [::Integer] + # Optional. The maximum number of accounts to return. The service might + # return fewer than this value. If unspecified, at most 50 accounts are + # returned. The maximum value is 1000; values above 1000 are coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListRelatedAccountGroupMemberships` call. + # + # When paginating, all other parameters provided to + # `ListRelatedAccountGroupMemberships` must match the call that provided the + # page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new + # + # # Call the list_related_account_group_memberships method. + # result = client.list_related_account_group_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + # p item + # end + # + def list_related_account_group_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_related_account_group_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_related_account_group_memberships.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_related_account_group_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :list_related_account_group_memberships, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_group_memberships, request, response, 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 group memberships related to a given account. + # + # @overload search_related_account_group_memberships(request, options = nil) + # Pass arguments to `search_related_account_group_memberships` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_related_account_group_memberships(project: nil, account_id: nil, hashed_account_id: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_related_account_group_memberships` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the project to search related account group + # memberships from. Specify the project name in the following format: + # `projects/{project}`. + # @param account_id [::String] + # Optional. The unique stable account identifier used to search connections. + # The identifier should correspond to an `account_id` provided in a previous + # `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + # or account_id must be set, but not both. + # @param hashed_account_id [::String] + # Optional. Deprecated: use `account_id` instead. + # The unique stable hashed account identifier used to search connections. The + # identifier should correspond to a `hashed_account_id` provided in a + # previous `CreateAssessment` or `AnnotateAssessment` call. Either + # hashed_account_id or account_id must be set, but not both. + # @param page_size [::Integer] + # Optional. The maximum number of groups to return. The service might return + # fewer than this value. If unspecified, at most 50 groups are returned. The + # maximum value is 1000; values above 1000 are coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `SearchRelatedAccountGroupMemberships` must match the call that provided + # the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new + # + # # Call the search_related_account_group_memberships method. + # result = client.search_related_account_group_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + # p item + # end + # + def search_related_account_group_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest + + # Converts hash and nil to 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_related_account_group_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION + metadata[:"x-goog-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 + header_params["project"] = request.project + end + + request_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_related_account_group_memberships.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_related_account_group_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :search_related_account_group_memberships, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :search_related_account_group_memberships, request, response, 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 RecaptchaEnterpriseService API. + # + # This class represents the configuration for RecaptchaEnterpriseService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_assessment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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 = "recaptchaenterprise.googleapis.com" + + config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_assessment + ## + # RPC-specific configuration for `annotate_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :annotate_assessment + ## + # RPC-specific configuration for `create_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_key + ## + # RPC-specific configuration for `list_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_keys + ## + # RPC-specific configuration for `retrieve_legacy_secret_key` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_legacy_secret_key + ## + # RPC-specific configuration for `get_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_key + ## + # RPC-specific configuration for `update_key` + # @return [::Gapic::Config::Method] + # + attr_reader :update_key + ## + # RPC-specific configuration for `delete_key` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_key + ## + # RPC-specific configuration for `migrate_key` + # @return [::Gapic::Config::Method] + # + attr_reader :migrate_key + ## + # RPC-specific configuration for `add_ip_override` + # @return [::Gapic::Config::Method] + # + attr_reader :add_ip_override + ## + # RPC-specific configuration for `remove_ip_override` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_ip_override + ## + # RPC-specific configuration for `list_ip_overrides` + # @return [::Gapic::Config::Method] + # + attr_reader :list_ip_overrides + ## + # RPC-specific configuration for `get_metrics` + # @return [::Gapic::Config::Method] + # + attr_reader :get_metrics + ## + # RPC-specific configuration for `create_firewall_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_firewall_policy + ## + # RPC-specific configuration for `list_firewall_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_firewall_policies + ## + # RPC-specific configuration for `get_firewall_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_firewall_policy + ## + # RPC-specific configuration for `update_firewall_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_firewall_policy + ## + # RPC-specific configuration for `delete_firewall_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_firewall_policy + ## + # RPC-specific configuration for `reorder_firewall_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :reorder_firewall_policies + ## + # RPC-specific configuration for `list_related_account_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_related_account_groups + ## + # RPC-specific configuration for `list_related_account_group_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :list_related_account_group_memberships + ## + # RPC-specific configuration for `search_related_account_group_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :search_related_account_group_memberships + + # @private + def initialize parent_rpcs = nil + create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment + @create_assessment = ::Gapic::Config::Method.new create_assessment_config + annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment + @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config + create_key_config = parent_rpcs.create_key if parent_rpcs.respond_to? :create_key + @create_key = ::Gapic::Config::Method.new create_key_config + list_keys_config = parent_rpcs.list_keys if parent_rpcs.respond_to? :list_keys + @list_keys = ::Gapic::Config::Method.new list_keys_config + retrieve_legacy_secret_key_config = parent_rpcs.retrieve_legacy_secret_key if parent_rpcs.respond_to? :retrieve_legacy_secret_key + @retrieve_legacy_secret_key = ::Gapic::Config::Method.new retrieve_legacy_secret_key_config + get_key_config = parent_rpcs.get_key if parent_rpcs.respond_to? :get_key + @get_key = ::Gapic::Config::Method.new get_key_config + update_key_config = parent_rpcs.update_key if parent_rpcs.respond_to? :update_key + @update_key = ::Gapic::Config::Method.new update_key_config + delete_key_config = parent_rpcs.delete_key if parent_rpcs.respond_to? :delete_key + @delete_key = ::Gapic::Config::Method.new delete_key_config + migrate_key_config = parent_rpcs.migrate_key if parent_rpcs.respond_to? :migrate_key + @migrate_key = ::Gapic::Config::Method.new migrate_key_config + add_ip_override_config = parent_rpcs.add_ip_override if parent_rpcs.respond_to? :add_ip_override + @add_ip_override = ::Gapic::Config::Method.new add_ip_override_config + remove_ip_override_config = parent_rpcs.remove_ip_override if parent_rpcs.respond_to? :remove_ip_override + @remove_ip_override = ::Gapic::Config::Method.new remove_ip_override_config + list_ip_overrides_config = parent_rpcs.list_ip_overrides if parent_rpcs.respond_to? :list_ip_overrides + @list_ip_overrides = ::Gapic::Config::Method.new list_ip_overrides_config + get_metrics_config = parent_rpcs.get_metrics if parent_rpcs.respond_to? :get_metrics + @get_metrics = ::Gapic::Config::Method.new get_metrics_config + create_firewall_policy_config = parent_rpcs.create_firewall_policy if parent_rpcs.respond_to? :create_firewall_policy + @create_firewall_policy = ::Gapic::Config::Method.new create_firewall_policy_config + list_firewall_policies_config = parent_rpcs.list_firewall_policies if parent_rpcs.respond_to? :list_firewall_policies + @list_firewall_policies = ::Gapic::Config::Method.new list_firewall_policies_config + get_firewall_policy_config = parent_rpcs.get_firewall_policy if parent_rpcs.respond_to? :get_firewall_policy + @get_firewall_policy = ::Gapic::Config::Method.new get_firewall_policy_config + update_firewall_policy_config = parent_rpcs.update_firewall_policy if parent_rpcs.respond_to? :update_firewall_policy + @update_firewall_policy = ::Gapic::Config::Method.new update_firewall_policy_config + delete_firewall_policy_config = parent_rpcs.delete_firewall_policy if parent_rpcs.respond_to? :delete_firewall_policy + @delete_firewall_policy = ::Gapic::Config::Method.new delete_firewall_policy_config + reorder_firewall_policies_config = parent_rpcs.reorder_firewall_policies if parent_rpcs.respond_to? :reorder_firewall_policies + @reorder_firewall_policies = ::Gapic::Config::Method.new reorder_firewall_policies_config + list_related_account_groups_config = parent_rpcs.list_related_account_groups if parent_rpcs.respond_to? :list_related_account_groups + @list_related_account_groups = ::Gapic::Config::Method.new list_related_account_groups_config + list_related_account_group_memberships_config = parent_rpcs.list_related_account_group_memberships if parent_rpcs.respond_to? :list_related_account_group_memberships + @list_related_account_group_memberships = ::Gapic::Config::Method.new list_related_account_group_memberships_config + search_related_account_group_memberships_config = parent_rpcs.search_related_account_group_memberships if parent_rpcs.respond_to? :search_related_account_group_memberships + @search_related_account_group_memberships = ::Gapic::Config::Method.new search_related_account_group_memberships_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb new file mode 100644 index 000000000000..5bad44dfdcb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_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 RecaptchaEnterprise + module V1 + module RecaptchaEnterpriseService + # Credentials for the RecaptchaEnterpriseService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECAPTCHA_ENTERPRISE_CREDENTIALS", + "RECAPTCHA_ENTERPRISE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON", + "RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb new file mode 100644 index 000000000000..7a41dbacecdb --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecaptchaEnterprise + module V1 + module RecaptchaEnterpriseService + # Path helper methods for the RecaptchaEnterpriseService API. + module Paths + ## + # Create a fully-qualified Assessment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/assessments/{assessment}` + # + # @param project [String] + # @param assessment [String] + # + # @return [::String] + def assessment_path project:, assessment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/assessments/#{assessment}" + end + + ## + # Create a fully-qualified FirewallPolicy resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/firewallpolicies/{firewallpolicy}` + # + # @param project [String] + # @param firewallpolicy [String] + # + # @return [::String] + def firewall_policy_path project:, firewallpolicy: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/firewallpolicies/#{firewallpolicy}" + end + + ## + # Create a fully-qualified Key resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/keys/{key}` + # + # @param project [String] + # @param key [String] + # + # @return [::String] + def key_path project:, key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/keys/#{key}" + end + + ## + # Create a fully-qualified Metrics resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/keys/{key}/metrics` + # + # @param project [String] + # @param key [String] + # + # @return [::String] + def metrics_path project:, key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/keys/#{key}/metrics" + 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 RelatedAccountGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}` + # + # @param project [String] + # @param relatedaccountgroup [String] + # + # @return [::String] + def related_account_group_path project:, relatedaccountgroup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/relatedaccountgroups/#{relatedaccountgroup}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb new file mode 100644 index 000000000000..6d793f226301 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb new file mode 100644 index 000000000000..2419a56f15fc --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n=google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto\x12#google.cloud.recaptchaenterprise.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa8\x01\n\x17\x43reateAssessmentRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12H\n\nassessment\x18\x02 \x01(\x0b\x32/.google.cloud.recaptchaenterprise.v1.AssessmentB\x03\xe0\x41\x02\"\x92\x05\n\x10TransactionEvent\x12\x63\n\nevent_type\x18\x01 \x01(\x0e\x32J.google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventTypeB\x03\xe0\x41\x01\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xba\x03\n\x14TransactionEventType\x12&\n\"TRANSACTION_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10MERCHANT_APPROVE\x10\x01\x12\x11\n\rMERCHANT_DENY\x10\x02\x12\x11\n\rMANUAL_REVIEW\x10\x03\x12\x11\n\rAUTHORIZATION\x10\x04\x12\x19\n\x15\x41UTHORIZATION_DECLINE\x10\x05\x12\x13\n\x0fPAYMENT_CAPTURE\x10\x06\x12\x1b\n\x17PAYMENT_CAPTURE_DECLINE\x10\x07\x12\n\n\x06\x43\x41NCEL\x10\x08\x12\x16\n\x12\x43HARGEBACK_INQUIRY\x10\t\x12\x14\n\x10\x43HARGEBACK_ALERT\x10\n\x12\x16\n\x12\x46RAUD_NOTIFICATION\x10\x0b\x12\x0e\n\nCHARGEBACK\x10\x0c\x12\x1c\n\x18\x43HARGEBACK_REPRESENTMENT\x10\r\x12\x16\n\x12\x43HARGEBACK_REVERSE\x10\x0e\x12\x12\n\x0eREFUND_REQUEST\x10\x0f\x12\x12\n\x0eREFUND_DECLINE\x10\x10\x12\n\n\x06REFUND\x10\x11\x12\x12\n\x0eREFUND_REVERSE\x10\x12\"j\n\x18PhoneAuthenticationEvent\x12\x19\n\x0cphone_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\nevent_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xeb\x07\n\x19\x41nnotateAssessmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recaptchaenterprise.googleapis.com/Assessment\x12\x62\n\nannotation\x18\x02 \x01(\x0e\x32I.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.AnnotationB\x03\xe0\x41\x01\x12[\n\x07reasons\x18\x03 \x03(\x0e\x32\x45.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.ReasonB\x03\xe0\x41\x01\x12\x17\n\naccount_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x01\x12U\n\x11transaction_event\x18\x05 \x01(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.TransactionEventB\x03\xe0\x41\x01\x12\x66\n\x1aphone_authentication_event\x18\x06 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEventB\x03\xe0\x41\x01\"~\n\nAnnotation\x12\x1a\n\x16\x41NNOTATION_UNSPECIFIED\x10\x00\x12\x0e\n\nLEGITIMATE\x10\x01\x12\x0e\n\nFRAUDULENT\x10\x02\x12\x18\n\x10PASSWORD_CORRECT\x10\x03\x1a\x02\x08\x01\x12\x1a\n\x12PASSWORD_INCORRECT\x10\x04\x1a\x02\x08\x01\"\xcf\x02\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nCHARGEBACK\x10\x01\x12\x14\n\x10\x43HARGEBACK_FRAUD\x10\x08\x12\x16\n\x12\x43HARGEBACK_DISPUTE\x10\t\x12\n\n\x06REFUND\x10\n\x12\x10\n\x0cREFUND_FRAUD\x10\x0b\x12\x18\n\x14TRANSACTION_ACCEPTED\x10\x0c\x12\x18\n\x14TRANSACTION_DECLINED\x10\r\x12\x16\n\x12PAYMENT_HEURISTICS\x10\x02\x12\x18\n\x14INITIATED_TWO_FACTOR\x10\x07\x12\x15\n\x11PASSED_TWO_FACTOR\x10\x03\x12\x15\n\x11\x46\x41ILED_TWO_FACTOR\x10\x04\x12\x14\n\x10\x43ORRECT_PASSWORD\x10\x05\x12\x16\n\x12INCORRECT_PASSWORD\x10\x06\x12\x0f\n\x0bSOCIAL_SPAM\x10\x0e\"\x1c\n\x1a\x41nnotateAssessmentResponse\"\xb4\x01\n\x18\x45ndpointVerificationInfo\x12\x17\n\remail_address\x18\x01 \x01(\tH\x00\x12\x16\n\x0cphone_number\x18\x02 \x01(\tH\x00\x12\x1a\n\rrequest_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x16last_verification_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\n\n\x08\x65ndpoint\"\xdb\x04\n\x17\x41\x63\x63ountVerificationInfo\x12U\n\tendpoints\x18\x01 \x03(\x0b\x32=.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfoB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12l\n\x1alatest_verification_result\x18\x07 \x01(\x0e\x32\x43.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.ResultB\x03\xe0\x41\x03\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\"\xc8\x02\n\x06Result\x12\x16\n\x12RESULT_UNSPECIFIED\x10\x00\x12\x19\n\x15SUCCESS_USER_VERIFIED\x10\x01\x12\x1b\n\x17\x45RROR_USER_NOT_VERIFIED\x10\x02\x12$\n ERROR_SITE_ONBOARDING_INCOMPLETE\x10\x03\x12\x1f\n\x1b\x45RROR_RECIPIENT_NOT_ALLOWED\x10\x04\x12)\n%ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED\x10\x05\x12\x1b\n\x17\x45RROR_CRITICAL_INTERNAL\x10\x06\x12\"\n\x1e\x45RROR_CUSTOMER_QUOTA_EXHAUSTED\x10\x07\x12\x1f\n\x1b\x45RROR_VERIFICATION_BYPASSED\x10\x08\x12\x1a\n\x16\x45RROR_VERDICT_MISMATCH\x10\t\"\xcc\x01\n\x1fPrivatePasswordLeakVerification\x12\x1f\n\x12lookup_hash_prefix\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12,\n\x1f\x65ncrypted_user_credentials_hash\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x12*\n\x1d\x65ncrypted_leak_match_prefixes\x18\x03 \x03(\x0c\x42\x03\xe0\x41\x03\x12.\n!reencrypted_user_credentials_hash\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x03\"\xa4\t\n\nAssessment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12>\n\x05\x65vent\x18\x02 \x01(\x0b\x32*.google.cloud.recaptchaenterprise.v1.EventB\x03\xe0\x41\x01\x12M\n\rrisk_analysis\x18\x03 \x01(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.RiskAnalysisB\x03\xe0\x41\x03\x12S\n\x10token_properties\x18\x04 \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.TokenPropertiesB\x03\xe0\x41\x03\x12_\n\x14\x61\x63\x63ount_verification\x18\x05 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.AccountVerificationInfoB\x03\xe0\x41\x01\x12h\n\x1b\x61\x63\x63ount_defender_assessment\x18\x06 \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessmentB\x03\xe0\x41\x03\x12u\n\"private_password_leak_verification\x18\x08 \x01(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerificationB\x03\xe0\x41\x01\x12\x66\n\x1a\x66irewall_policy_assessment\x18\n \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessmentB\x03\xe0\x41\x03\x12h\n\x1b\x66raud_prevention_assessment\x18\x0b \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessmentB\x03\xe0\x41\x03\x12M\n\rfraud_signals\x18\r \x01(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.FraudSignalsB\x03\xe0\x41\x03\x12^\n\x16phone_fraud_assessment\x18\x0c \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessmentB\x03\xe0\x41\x03\x12_\n\x16\x61ssessment_environment\x18\x0e \x01(\x0b\x32:.google.cloud.recaptchaenterprise.v1.AssessmentEnvironmentB\x03\xe0\x41\x01:x\xea\x41u\n-recaptchaenterprise.googleapis.com/Assessment\x12+projects/{project}/assessments/{assessment}*\x0b\x61ssessments2\nassessment\"\xb0\x05\n\x05\x45vent\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08site_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12$\n\x0fuser_ip_address\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x1c\n\x0f\x65xpected_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x11hashed_account_id\x18\x06 \x01(\x0c\x42\x05\x18\x01\xe0\x41\x01\x12\x14\n\x07\x65xpress\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rrequested_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14waf_token_assessment\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x10\n\x03ja3\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03ja4\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07headers\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\'\n\x1a\x66irewall_policy_evaluation\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\x10transaction_data\x18\r \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.TransactionDataB\x03\xe0\x41\x01\x12\x45\n\tuser_info\x18\x0f \x01(\x0b\x32-.google.cloud.recaptchaenterprise.v1.UserInfoB\x03\xe0\x41\x01\x12Y\n\x10\x66raud_prevention\x18\x11 \x01(\x0e\x32:.google.cloud.recaptchaenterprise.v1.Event.FraudPreventionB\x03\xe0\x41\x01\"N\n\x0f\x46raudPrevention\x12 \n\x1c\x46RAUD_PREVENTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\xa0\n\n\x0fTransactionData\x12\x1b\n\x0etransaction_id\x18\x0b \x01(\tH\x00\x88\x01\x01\x12\x1b\n\x0epayment_method\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x63\x61rd_bin\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x63\x61rd_last_four\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x05 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0eshipping_value\x18\x0c \x01(\x01\x42\x03\xe0\x41\x01\x12[\n\x10shipping_address\x18\x06 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.TransactionData.AddressB\x03\xe0\x41\x01\x12Z\n\x0f\x62illing_address\x18\x07 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.TransactionData.AddressB\x03\xe0\x41\x01\x12L\n\x04user\x18\x08 \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.UserB\x03\xe0\x41\x01\x12Q\n\tmerchants\x18\r \x03(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.UserB\x03\xe0\x41\x01\x12M\n\x05items\x18\x0e \x03(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.ItemB\x03\xe0\x41\x01\x12[\n\x0cgateway_info\x18\n \x01(\x0b\x32@.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfoB\x03\xe0\x41\x01\x1a\xa4\x01\n\x07\x41\x64\x64ress\x12\x16\n\trecipient\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08locality\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x61\x64ministrative_area\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bregion_code\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bpostal_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1a\xa2\x01\n\x04User\x12\x17\n\naccount_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63reation_ms\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x12\n\x05\x65mail\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65mail_verified\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0cphone_number\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ephone_verified\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x66\n\x04Item\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01\x12 \n\x13merchant_account_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x84\x01\n\x0bGatewayInfo\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15gateway_response_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x61vs_response_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x63vv_response_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x42\x11\n\x0f_transaction_id\"\xa5\x01\n\x08UserInfo\x12<\n\x13\x63reate_account_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x17\n\naccount_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\x08user_ids\x18\x03 \x03(\x0b\x32+.google.cloud.recaptchaenterprise.v1.UserIdB\x03\xe0\x41\x01\"`\n\x06UserId\x12\x14\n\x05\x65mail\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x1b\n\x0cphone_number\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x17\n\x08username\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x42\n\n\x08id_oneof\"\xfd\x04\n\x0cRiskAnalysis\x12\x12\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\\\n\x07reasons\x18\x02 \x03(\x0e\x32\x46.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReasonB\x03\xe0\x41\x03\x12%\n\x18\x65xtended_verdict_reasons\x18\x03 \x03(\tB\x03\xe0\x41\x03\x12S\n\tchallenge\x18\x04 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ChallengeB\x03\xe0\x41\x03\x12\x44\n\rverified_bots\x18\x05 \x03(\x0b\x32(.google.cloud.recaptchaenterprise.v1.BotB\x03\xe0\x41\x03\"\xe9\x01\n\x14\x43lassificationReason\x12%\n!CLASSIFICATION_REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nAUTOMATION\x10\x01\x12\x1a\n\x16UNEXPECTED_ENVIRONMENT\x10\x02\x12\x14\n\x10TOO_MUCH_TRAFFIC\x10\x03\x12\x1d\n\x19UNEXPECTED_USAGE_PATTERNS\x10\x04\x12\x18\n\x14LOW_CONFIDENCE_SCORE\x10\x05\x12\x15\n\x11SUSPECTED_CARDING\x10\x06\x12\x18\n\x14SUSPECTED_CHARGEBACK\x10\x07\"M\n\tChallenge\x12\x19\n\x15\x43HALLENGE_UNSPECIFIED\x10\x00\x12\r\n\tNOCAPTCHA\x10\x01\x12\n\n\x06PASSED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"\xbd\x01\n\x03\x42ot\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12G\n\x08\x62ot_type\x18\x02 \x01(\x0e\x32\x30.google.cloud.recaptchaenterprise.v1.Bot.BotTypeB\x03\xe0\x41\x01\"Z\n\x07\x42otType\x12\x18\n\x14\x42OT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41I_AGENT\x10\x01\x12\x13\n\x0f\x43ONTENT_SCRAPER\x10\x02\x12\x12\n\x0eSEARCH_INDEXER\x10\x03\"\xd2\x03\n\x0fTokenProperties\x12\x12\n\x05valid\x18\x01 \x01(\x08\x42\x03\xe0\x41\x03\x12_\n\x0einvalid_reason\x18\x02 \x01(\x0e\x32\x42.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReasonB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08hostname\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12!\n\x14\x61ndroid_package_name\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rios_bundle_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06\x61\x63tion\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\xa8\x01\n\rInvalidReason\x12\x1e\n\x1aINVALID_REASON_UNSPECIFIED\x10\x00\x12\x1a\n\x16UNKNOWN_INVALID_REASON\x10\x01\x12\r\n\tMALFORMED\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03\x12\x08\n\x04\x44UPE\x10\x04\x12\x0b\n\x07MISSING\x10\x05\x12\x11\n\rBROWSER_ERROR\x10\x06\x12\x15\n\x11UNEXPECTED_ACTION\x10\x07\"\xd0\x07\n\x19\x46raudPreventionAssessment\x12\x1d\n\x10transaction_risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x64\n\x0crisk_reasons\x18\x06 \x03(\x0b\x32I.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReasonB\x03\xe0\x41\x03\x12~\n\x19stolen_instrument_verdict\x18\x02 \x01(\x0b\x32V.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdictB\x03\xe0\x41\x03\x12t\n\x14\x63\x61rd_testing_verdict\x18\x03 \x01(\x0b\x32Q.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdictB\x03\xe0\x41\x03\x12|\n\x18\x62\x65havioral_trust_verdict\x18\x04 \x01(\x0b\x32U.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdictB\x03\xe0\x41\x03\x1a\xb4\x02\n\nRiskReason\x12\x65\n\x06reason\x18\x01 \x01(\x0e\x32P.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason.ReasonB\x03\xe0\x41\x03\"\xbe\x01\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19HIGH_TRANSACTION_VELOCITY\x10\x01\x12!\n\x1d\x45XCESSIVE_ENUMERATION_PATTERN\x10\x02\x12\x1a\n\x16SHORT_IDENTITY_HISTORY\x10\x03\x12\x1b\n\x17GEOLOCATION_DISCREPANCY\x10\x04\x12!\n\x1d\x41SSOCIATED_WITH_FRAUD_CLUSTER\x10\x05\x1a,\n\x17StolenInstrumentVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a\'\n\x12\x43\x61rdTestingVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a,\n\x16\x42\x65havioralTrustVerdict\x12\x12\n\x05trust\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\"\xe3\x03\n\x0c\x46raudSignals\x12X\n\x0cuser_signals\x18\x01 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignalsB\x03\xe0\x41\x03\x12X\n\x0c\x63\x61rd_signals\x18\x02 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignalsB\x03\xe0\x41\x03\x1aP\n\x0bUserSignals\x12$\n\x17\x61\x63tive_days_lower_bound\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1b\n\x0esynthetic_risk\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03\x1a\xcc\x01\n\x0b\x43\x61rdSignals\x12\x61\n\x0b\x63\x61rd_labels\x18\x01 \x03(\x0e\x32G.google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabelB\x03\xe0\x41\x03\"Z\n\tCardLabel\x12\x1a\n\x16\x43\x41RD_LABEL_UNSPECIFIED\x10\x00\x12\x0b\n\x07PREPAID\x10\x01\x12\x0b\n\x07VIRTUAL\x10\x02\x12\x17\n\x13UNEXPECTED_LOCATION\x10\x03\"\xe2\x01\n\x13SmsTollFraudVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x61\n\x07reasons\x18\x02 \x03(\x0e\x32K.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReasonB\x03\xe0\x41\x03\"U\n\x12SmsTollFraudReason\x12%\n!SMS_TOLL_FRAUD_REASON_UNSPECIFIED\x10\x00\x12\x18\n\x14INVALID_PHONE_NUMBER\x10\x01\"u\n\x14PhoneFraudAssessment\x12]\n\x16sms_toll_fraud_verdict\x18\x01 \x01(\x0b\x32\x38.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdictB\x03\xe0\x41\x03\"\xbb\x02\n\x19\x41\x63\x63ountDefenderAssessment\x12h\n\x06labels\x18\x01 \x03(\x0e\x32S.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabelB\x03\xe0\x41\x03\"\xb3\x01\n\x14\x41\x63\x63ountDefenderLabel\x12&\n\"ACCOUNT_DEFENDER_LABEL_UNSPECIFIED\x10\x00\x12\x11\n\rPROFILE_MATCH\x10\x01\x12\x1d\n\x19SUSPICIOUS_LOGIN_ACTIVITY\x10\x02\x12\x1f\n\x1bSUSPICIOUS_ACCOUNT_CREATION\x10\x03\x12 \n\x1cRELATED_ACCOUNTS_NUMBER_HIGH\x10\x04\"\x93\x01\n\x10\x43reateKeyRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12:\n\x03key\x18\x02 \x01(\x0b\x32(.google.cloud.recaptchaenterprise.v1.KeyB\x03\xe0\x41\x02\"\x87\x01\n\x0fListKeysRequest\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\"c\n\x10ListKeysResponse\x12\x36\n\x04keys\x18\x01 \x03(\x0b\x32(.google.cloud.recaptchaenterprise.v1.Key\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x1eRetrieveLegacySecretKeyRequest\x12;\n\x03key\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"M\n\rGetKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"\x84\x01\n\x10UpdateKeyRequest\x12:\n\x03key\x18\x01 \x01(\x0b\x32(.google.cloud.recaptchaenterprise.v1.KeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"P\n\x10\x44\x65leteKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"\xb5\x01\n\x1b\x43reateFirewallPolicyRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12Q\n\x0f\x66irewall_policy\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x02\"\x93\x01\n\x1bListFirewallPoliciesRequest\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\"\x87\x01\n\x1cListFirewallPoliciesResponse\x12N\n\x11\x66irewall_policies\x18\x01 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"c\n\x18GetFirewallPolicyRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"\xa6\x01\n\x1bUpdateFirewallPolicyRequest\x12Q\n\x0f\x66irewall_policy\x18\x01 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"f\n\x1b\x44\x65leteFirewallPolicyRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"\xaf\x01\n\x1eReorderFirewallPoliciesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12H\n\x05names\x18\x02 \x03(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"!\n\x1fReorderFirewallPoliciesResponse\"r\n\x11MigrateKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12\x1f\n\x12skip_billing_check\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"U\n\x11GetMetricsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*recaptchaenterprise.googleapis.com/Metrics\"\xd5\x02\n\x07Metrics\x12\x14\n\x04name\x18\x04 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12H\n\rscore_metrics\x18\x02 \x03(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.ScoreMetrics\x12P\n\x11\x63hallenge_metrics\x18\x03 \x03(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.ChallengeMetrics:h\xea\x41\x65\n*recaptchaenterprise.googleapis.com/Metrics\x12%projects/{project}/keys/{key}/metrics*\x07metrics2\x07metrics\"<\n\x1fRetrieveLegacySecretKeyResponse\x12\x19\n\x11legacy_secret_key\x18\x01 \x01(\t\"\xb3\x06\n\x03Key\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0cweb_settings\x18\x03 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.WebKeySettingsH\x00\x12S\n\x10\x61ndroid_settings\x18\x04 \x01(\x0b\x32\x37.google.cloud.recaptchaenterprise.v1.AndroidKeySettingsH\x00\x12K\n\x0cios_settings\x18\x05 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IOSKeySettingsH\x00\x12S\n\x10\x65xpress_settings\x18\x0b \x01(\x0b\x32\x37.google.cloud.recaptchaenterprise.v1.ExpressKeySettingsH\x00\x12I\n\x06labels\x18\x06 \x03(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.Key.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x0ftesting_options\x18\t \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.TestingOptionsB\x03\xe0\x41\x01\x12K\n\x0cwaf_settings\x18\n \x01(\x0b\x32\x30.google.cloud.recaptchaenterprise.v1.WafSettingsB\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:U\xea\x41R\n&recaptchaenterprise.googleapis.com/Key\x12\x1dprojects/{project}/keys/{key}*\x04keys2\x03keyB\x13\n\x11platform_settings\"\xf2\x01\n\x0eTestingOptions\x12\x1a\n\rtesting_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01\x12\x64\n\x11testing_challenge\x18\x02 \x01(\x0e\x32\x44.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallengeB\x03\xe0\x41\x01\"^\n\x10TestingChallenge\x12!\n\x1dTESTING_CHALLENGE_UNSPECIFIED\x10\x00\x12\r\n\tNOCAPTCHA\x10\x01\x12\x18\n\x14UNSOLVABLE_CHALLENGE\x10\x02\"\xc5\x08\n\x0eWebKeySettings\x12\x1e\n\x11\x61llow_all_domains\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x61llowed_domains\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x61llow_amp_traffic\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x62\n\x10integration_type\x18\x04 \x01(\x0e\x32\x43.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationTypeB\x03\xe0\x41\x02\x12{\n\x1d\x63hallenge_security_preference\x18\x05 \x01(\x0e\x32O.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreferenceB\x03\xe0\x41\x01\x12\x66\n\x12\x63hallenge_settings\x18\x06 \x01(\x0b\x32\x45.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettingsB\x03\xe0\x41\x01\x1a.\n\x0e\x41\x63tionSettings\x12\x1c\n\x0fscore_threshold\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x1a\xea\x02\n\x11\x43hallengeSettings\x12\x61\n\x10\x64\x65\x66\x61ult_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettingsB\x03\xe0\x41\x02\x12w\n\x0f\x61\x63tion_settings\x18\x02 \x03(\x0b\x32Y.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettings.ActionSettingsEntryB\x03\xe0\x41\x01\x1ay\n\x13\x41\x63tionSettingsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettings:\x02\x38\x01\"w\n\x0fIntegrationType\x12 \n\x1cINTEGRATION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SCORE\x10\x01\x12\x0c\n\x08\x43HECKBOX\x10\x02\x12\r\n\tINVISIBLE\x10\x03\x12\x1a\n\x16POLICY_BASED_CHALLENGE\x10\x05\"v\n\x1b\x43hallengeSecurityPreference\x12-\n)CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED\x10\x00\x12\r\n\tUSABILITY\x10\x01\x12\x0b\n\x07\x42\x41LANCE\x10\x02\x12\x0c\n\x08SECURITY\x10\x03\"\x96\x01\n\x12\x41ndroidKeySettings\x12$\n\x17\x61llow_all_package_names\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\"\n\x15\x61llowed_package_names\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x36\n)support_non_google_app_store_distribution\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xac\x01\n\x0eIOSKeySettings\x12!\n\x14\x61llow_all_bundle_ids\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61llowed_bundle_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12V\n\x12\x61pple_developer_id\x18\x03 \x01(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.AppleDeveloperIdB\x03\xe0\x41\x01\"\x14\n\x12\x45xpressKeySettings\"Z\n\x10\x41ppleDeveloperId\x12\x1b\n\x0bprivate_key\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07team_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa9\x01\n\x11ScoreDistribution\x12_\n\rscore_buckets\x18\x01 \x03(\x0b\x32H.google.cloud.recaptchaenterprise.v1.ScoreDistribution.ScoreBucketsEntry\x1a\x33\n\x11ScoreBucketsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\xab\x02\n\x0cScoreMetrics\x12O\n\x0foverall_metrics\x18\x01 \x01(\x0b\x32\x36.google.cloud.recaptchaenterprise.v1.ScoreDistribution\x12\\\n\x0e\x61\x63tion_metrics\x18\x02 \x03(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.ScoreMetrics.ActionMetricsEntry\x1al\n\x12\x41\x63tionMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.recaptchaenterprise.v1.ScoreDistribution:\x02\x38\x01\"o\n\x10\x43hallengeMetrics\x12\x16\n\x0epageload_count\x18\x01 \x01(\x03\x12\x17\n\x0fnocaptcha_count\x18\x02 \x01(\x03\x12\x14\n\x0c\x66\x61iled_count\x18\x03 \x01(\x03\x12\x14\n\x0cpassed_count\x18\x04 \x01(\x03\"\x95\x01\n\x18\x46irewallPolicyAssessment\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12Q\n\x0f\x66irewall_policy\x18\x08 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x03\"\x82\x06\n\x0e\x46irewallAction\x12P\n\x05\x61llow\x18\x01 \x01(\x0b\x32?.google.cloud.recaptchaenterprise.v1.FirewallAction.AllowActionH\x00\x12P\n\x05\x62lock\x18\x02 \x01(\x0b\x32?.google.cloud.recaptchaenterprise.v1.FirewallAction.BlockActionH\x00\x12t\n\x18include_recaptcha_script\x18\x06 \x01(\x0b\x32P.google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptActionH\x00\x12V\n\x08redirect\x18\x05 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectActionH\x00\x12Z\n\nsubstitute\x18\x03 \x01(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteActionH\x00\x12Y\n\nset_header\x18\x04 \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderActionH\x00\x1a\r\n\x0b\x41llowAction\x1a\r\n\x0b\x42lockAction\x1a\x1e\n\x1cIncludeRecaptchaScriptAction\x1a\x10\n\x0eRedirectAction\x1a%\n\x10SubstituteAction\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x37\n\x0fSetHeaderAction\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x17\n\x15\x66irewall_action_oneof\"\xc5\x02\n\x0e\x46irewallPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04path\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tcondition\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12I\n\x07\x61\x63tions\x18\x06 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallActionB\x03\xe0\x41\x01:\x8f\x01\xea\x41\x8b\x01\n1recaptchaenterprise.googleapis.com/FirewallPolicy\x12\x34projects/{project}/firewallpolicies/{firewallpolicy}*\x10\x66irewallPolicies2\x0e\x66irewallPolicy\"\xb6\x01\n)ListRelatedAccountGroupMembershipsRequest\x12X\n\x06parent\x18\x01 \x01(\tBH\xe0\x41\x02\xfa\x41\x42\x12@recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership\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\"\xb4\x01\n*ListRelatedAccountGroupMembershipsResponse\x12m\n!related_account_group_memberships\x18\x01 \x03(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa2\x01\n\x1fListRelatedAccountGroupsRequest\x12N\n\x06parent\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\x12\x36recaptchaenterprise.googleapis.com/RelatedAccountGroup\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\"\x95\x01\n ListRelatedAccountGroupsResponse\x12X\n\x16related_account_groups\x18\x01 \x03(\x0b\x32\x38.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xdf\x01\n+SearchRelatedAccountGroupMembershipsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x17\n\naccount_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x11hashed_account_id\x18\x02 \x01(\x0c\x42\x05\x18\x01\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb6\x01\n,SearchRelatedAccountGroupMembershipsResponse\x12m\n!related_account_group_memberships\x18\x01 \x03(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x14\x41\x64\x64IpOverrideRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12R\n\x10ip_override_data\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideDataB\x03\xe0\x41\x02\"\x17\n\x15\x41\x64\x64IpOverrideResponse\"\xab\x01\n\x17RemoveIpOverrideRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12R\n\x10ip_override_data\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideDataB\x03\xe0\x41\x02\"\x1a\n\x18RemoveIpOverrideResponse\"\x89\x01\n\x16ListIpOverridesRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\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\x17ListIpOverridesResponse\x12I\n\x0cip_overrides\x18\x01 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideData\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc8\x02\n\x1dRelatedAccountGroupMembership\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x02\x12\x12\n\naccount_id\x18\x04 \x01(\t\x12\x1d\n\x11hashed_account_id\x18\x02 \x01(\x0c\x42\x02\x18\x01:\xdd\x01\xea\x41\xd9\x01\n@recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership\x12Vprojects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}*\x1erelatedAccountGroupMemberships2\x1drelatedAccountGroupMembership\"\xd4\x01\n\x13RelatedAccountGroup\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x02:\xa6\x01\xea\x41\xa2\x01\n6recaptchaenterprise.googleapis.com/RelatedAccountGroup\x12=projects/{project}/relatedaccountgroups/{relatedaccountgroup}*\x14relatedAccountGroups2\x13relatedAccountGroup\"\x8b\x03\n\x0bWafSettings\x12U\n\x0bwaf_service\x18\x01 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.WafSettings.WafServiceB\x03\xe0\x41\x02\x12U\n\x0bwaf_feature\x18\x02 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeatureB\x03\xe0\x41\x02\"s\n\nWafFeature\x12\x1b\n\x17WAF_FEATURE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43HALLENGE_PAGE\x10\x01\x12\x11\n\rSESSION_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43TION_TOKEN\x10\x03\x12\x0f\n\x07\x45XPRESS\x10\x05\x1a\x02\x08\x01\"Y\n\nWafService\x12\x1b\n\x17WAF_SERVICE_UNSPECIFIED\x10\x00\x12\x06\n\x02\x43\x41\x10\x01\x12\n\n\x06\x46\x41STLY\x10\x03\x12\x0e\n\nCLOUDFLARE\x10\x04\x12\n\n\x06\x41KAMAI\x10\x05\"B\n\x15\x41ssessmentEnvironment\x12\x13\n\x06\x63lient\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xc1\x01\n\x0eIpOverrideData\x12\x17\n\x02ip\x18\x01 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\\\n\roverride_type\x18\x03 \x01(\x0e\x32@.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideTypeB\x03\xe0\x41\x02\"8\n\x0cOverrideType\x12\x1d\n\x19OVERRIDE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x32\xe5$\n\x1aRecaptchaEnterpriseService\x12\xce\x01\n\x10\x43reateAssessment\x12<.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest\x1a/.google.cloud.recaptchaenterprise.v1.Assessment\"K\xda\x41\x11parent,assessment\x82\xd3\xe4\x93\x02\x31\"#/v1/{parent=projects/*}/assessments:\nassessment\x12\xe0\x01\n\x12\x41nnotateAssessment\x12>.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest\x1a?.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse\"I\xda\x41\x0fname,annotation\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/assessments/*}:annotate:\x01*\x12\xa4\x01\n\tCreateKey\x12\x35.google.cloud.recaptchaenterprise.v1.CreateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"6\xda\x41\nparent,key\x82\xd3\xe4\x93\x02#\"\x1c/v1/{parent=projects/*}/keys:\x03key\x12\xa6\x01\n\x08ListKeys\x12\x34.google.cloud.recaptchaenterprise.v1.ListKeysRequest\x1a\x35.google.cloud.recaptchaenterprise.v1.ListKeysResponse\"-\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=projects/*}/keys\x12\xe7\x01\n\x17RetrieveLegacySecretKey\x12\x43.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest\x1a\x44.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse\"A\xda\x41\x03key\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey\x12\x93\x01\n\x06GetKey\x12\x32.google.cloud.recaptchaenterprise.v1.GetKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"+\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{name=projects/*/keys/*}\x12\xad\x01\n\tUpdateKey\x12\x35.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"?\xda\x41\x0fkey,update_mask\x82\xd3\xe4\x93\x02\'2 /v1/{key.name=projects/*/keys/*}:\x03key\x12\x87\x01\n\tDeleteKey\x12\x35.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest\x1a\x16.google.protobuf.Empty\"+\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1e*\x1c/v1/{name=projects/*/keys/*}\x12\x9f\x01\n\nMigrateKey\x12\x36.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"/\x82\xd3\xe4\x93\x02)\"$/v1/{name=projects/*/keys/*}:migrate:\x01*\x12\xd5\x01\n\rAddIpOverride\x12\x39.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest\x1a:.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse\"M\xda\x41\x15name,ip_override_data\x82\xd3\xe4\x93\x02/\"*/v1/{name=projects/*/keys/*}:addIpOverride:\x01*\x12\xe1\x01\n\x10RemoveIpOverride\x12<.google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest\x1a=.google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse\"P\xda\x41\x15name,ip_override_data\x82\xd3\xe4\x93\x02\x32\"-/v1/{name=projects/*/keys/*}:removeIpOverride:\x01*\x12\xcd\x01\n\x0fListIpOverrides\x12;.google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest\x1a<.google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/keys/*}:listIpOverrides\x12\xa7\x01\n\nGetMetrics\x12\x36.google.cloud.recaptchaenterprise.v1.GetMetricsRequest\x1a,.google.cloud.recaptchaenterprise.v1.Metrics\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1/{name=projects/*/keys/*/metrics}\x12\xe9\x01\n\x14\x43reateFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"Z\xda\x41\x16parent,firewall_policy\x82\xd3\xe4\x93\x02;\"(/v1/{parent=projects/*}/firewallpolicies:\x0f\x66irewall_policy\x12\xd6\x01\n\x14ListFirewallPolicies\x12@.google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest\x1a\x41.google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*}/firewallpolicies\x12\xc0\x01\n\x11GetFirewallPolicy\x12=.google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/firewallpolicies/*}\x12\xfe\x01\n\x14UpdateFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"o\xda\x41\x1b\x66irewall_policy,update_mask\x82\xd3\xe4\x93\x02K28/v1/{firewall_policy.name=projects/*/firewallpolicies/*}:\x0f\x66irewall_policy\x12\xa9\x01\n\x14\x44\x65leteFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/firewallpolicies/*}\x12\xf0\x01\n\x17ReorderFirewallPolicies\x12\x43.google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest\x1a\x44.google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse\"J\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x35\"0/v1/{parent=projects/*}/firewallpolicies:reorder:\x01*\x12\xe6\x01\n\x18ListRelatedAccountGroups\x12\x44.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest\x1a\x45.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*}/relatedaccountgroups\x12\x92\x02\n\"ListRelatedAccountGroupMemberships\x12N.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest\x1aO.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/relatedaccountgroups/*}/memberships\x12\xb2\x02\n$SearchRelatedAccountGroupMemberships\x12P.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest\x1aQ.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse\"e\xda\x41\x19project,hashed_account_id\x82\xd3\xe4\x93\x02\x43\">/v1/{project=projects/*}/relatedaccountgroupmemberships:search:\x01*\x1aV\xca\x41\"recaptchaenterprise.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x99\x02\n!com.google.recaptchaenterprise.v1B\x18RecaptchaEnterpriseProtoP\x01Z\\cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb;recaptchaenterprisepb\xa2\x02\x04GCRE\xaa\x02#Google.Cloud.RecaptchaEnterprise.V1\xca\x02#Google\\Cloud\\RecaptchaEnterprise\\V1\xea\x02&Google::Cloud::RecaptchaEnterprise::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.FieldMask", "google/protobuf/field_mask.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 RecaptchaEnterprise + module V1 + CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest").msgclass + TransactionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionEvent").msgclass + TransactionEvent::TransactionEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType").enummodule + PhoneAuthenticationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEvent").msgclass + AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest").msgclass + AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation").enummodule + AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason").enummodule + AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse").msgclass + EndpointVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo").msgclass + AccountVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountVerificationInfo").msgclass + AccountVerificationInfo::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result").enummodule + PrivatePasswordLeakVerification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification").msgclass + Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Assessment").msgclass + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event").msgclass + Event::FraudPrevention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event.FraudPrevention").enummodule + TransactionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData").msgclass + TransactionData::Address = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.Address").msgclass + TransactionData::User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.User").msgclass + TransactionData::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.Item").msgclass + TransactionData::GatewayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo").msgclass + UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UserInfo").msgclass + UserId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UserId").msgclass + RiskAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis").msgclass + RiskAnalysis::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason").enummodule + RiskAnalysis::Challenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge").enummodule + Bot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Bot").msgclass + Bot::BotType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Bot.BotType").enummodule + TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties").msgclass + TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason").enummodule + FraudPreventionAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment").msgclass + FraudPreventionAssessment::RiskReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason").msgclass + FraudPreventionAssessment::RiskReason::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason.Reason").enummodule + FraudPreventionAssessment::StolenInstrumentVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict").msgclass + FraudPreventionAssessment::CardTestingVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict").msgclass + FraudPreventionAssessment::BehavioralTrustVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict").msgclass + FraudSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals").msgclass + FraudSignals::UserSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals").msgclass + FraudSignals::CardSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals").msgclass + FraudSignals::CardSignals::CardLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel").enummodule + SmsTollFraudVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict").msgclass + SmsTollFraudVerdict::SmsTollFraudReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason").enummodule + PhoneFraudAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment").msgclass + AccountDefenderAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment").msgclass + AccountDefenderAssessment::AccountDefenderLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel").enummodule + CreateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateKeyRequest").msgclass + ListKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysRequest").msgclass + ListKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysResponse").msgclass + RetrieveLegacySecretKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest").msgclass + GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetKeyRequest").msgclass + UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateKeyRequest").msgclass + DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteKeyRequest").msgclass + CreateFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest").msgclass + ListFirewallPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest").msgclass + ListFirewallPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse").msgclass + GetFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest").msgclass + UpdateFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest").msgclass + DeleteFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest").msgclass + ReorderFirewallPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest").msgclass + ReorderFirewallPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse").msgclass + MigrateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.MigrateKeyRequest").msgclass + GetMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetMetricsRequest").msgclass + Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Metrics").msgclass + RetrieveLegacySecretKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse").msgclass + Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Key").msgclass + TestingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions").msgclass + TestingOptions::TestingChallenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge").enummodule + WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings").msgclass + WebKeySettings::ActionSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettings").msgclass + WebKeySettings::ChallengeSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettings").msgclass + WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType").enummodule + WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference").enummodule + AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AndroidKeySettings").msgclass + IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IOSKeySettings").msgclass + ExpressKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ExpressKeySettings").msgclass + AppleDeveloperId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AppleDeveloperId").msgclass + ScoreDistribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreDistribution").msgclass + ScoreMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreMetrics").msgclass + ChallengeMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ChallengeMetrics").msgclass + FirewallPolicyAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment").msgclass + FirewallAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction").msgclass + FirewallAction::AllowAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction").msgclass + FirewallAction::BlockAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction").msgclass + FirewallAction::IncludeRecaptchaScriptAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction").msgclass + FirewallAction::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction").msgclass + FirewallAction::SubstituteAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction").msgclass + FirewallAction::SetHeaderAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction").msgclass + FirewallPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallPolicy").msgclass + ListRelatedAccountGroupMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest").msgclass + ListRelatedAccountGroupMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse").msgclass + ListRelatedAccountGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest").msgclass + ListRelatedAccountGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse").msgclass + SearchRelatedAccountGroupMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest").msgclass + SearchRelatedAccountGroupMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse").msgclass + AddIpOverrideRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest").msgclass + AddIpOverrideResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse").msgclass + RemoveIpOverrideRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest").msgclass + RemoveIpOverrideResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse").msgclass + ListIpOverridesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest").msgclass + ListIpOverridesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse").msgclass + RelatedAccountGroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership").msgclass + RelatedAccountGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RelatedAccountGroup").msgclass + WafSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings").msgclass + WafSettings::WafFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature").enummodule + WafSettings::WafService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings.WafService").enummodule + AssessmentEnvironment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AssessmentEnvironment").msgclass + IpOverrideData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IpOverrideData").msgclass + IpOverrideData::OverrideType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb new file mode 100644 index 000000000000..86e7915c82df --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb @@ -0,0 +1,105 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.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/recaptchaenterprise/v1/recaptchaenterprise_pb' + +module Google + module Cloud + module RecaptchaEnterprise + module V1 + module RecaptchaEnterpriseService + # Service to determine the likelihood an event is legitimate. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' + + # Creates an Assessment of the likelihood an event is legitimate. + rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Assessment + # Annotates a previously created Assessment to provide additional information + # on whether the event turned out to be authentic or fraudulent. + rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse + # Creates a new reCAPTCHA Enterprise key. + rpc :CreateKey, ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key + # Returns the list of all keys that belong to a project. + rpc :ListKeys, ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse + # Returns the secret key related to the specified public key. + # You must use the legacy secret key only in a 3rd party integration with + # legacy reCAPTCHA. + rpc :RetrieveLegacySecretKey, ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse + # Returns the specified key. + rpc :GetKey, ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key + # Updates the specified key. + rpc :UpdateKey, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key + # Deletes the specified key. + rpc :DeleteKey, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Google::Protobuf::Empty + # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + # Once a key is migrated, it can be used from either product. SiteVerify + # requests are billed as CreateAssessment calls. You must be + # authenticated as one of the current owners of the reCAPTCHA Key, and + # your user must have the reCAPTCHA Enterprise Admin IAM role in the + # destination project. + rpc :MigrateKey, ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key + # Adds an IP override to a key. The following restrictions hold: + # * The maximum number of IP overrides per key is 1000. + # * For any conflict (such as IP already exists or IP part of an existing + # IP range), an error is returned. + rpc :AddIpOverride, ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse + # Removes an IP override from a key. The following restrictions hold: + # * If the IP isn't found in an existing IP override, a `NOT_FOUND` error + # is returned. + # * If the IP is found in an existing IP override, but the + # override type does not match, a `NOT_FOUND` error is returned. + rpc :RemoveIpOverride, ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse + # Lists all IP overrides for a key. + rpc :ListIpOverrides, ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse + # Get some aggregated metrics for a Key. This data can be used to build + # dashboards. + rpc :GetMetrics, ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Metrics + # Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA + # Enterprise actions can be executed. + # A project may have a maximum of 1000 policies. + rpc :CreateFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy + # Returns the list of all firewall policies that belong to a project. + rpc :ListFirewallPolicies, ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse + # Returns the specified firewall policy. + rpc :GetFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy + # Updates the specified firewall policy. + rpc :UpdateFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy + # Deletes the specified firewall policy. + rpc :DeleteFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::Google::Protobuf::Empty + # Reorders all firewall policies. + rpc :ReorderFirewallPolicies, ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse + # List groups of related accounts. + rpc :ListRelatedAccountGroups, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse + # Get memberships in a group of related accounts. + rpc :ListRelatedAccountGroupMemberships, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse + # Search group memberships related to a given account. + rpc :SearchRelatedAccountGroupMemberships, ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md new file mode 100644 index 000000000000..5801e8b5fa14 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# reCAPTCHA Enterprise 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-recaptcha_enterprise-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb new file mode 100644 index 000000000000..56c8b1952bff --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb @@ -0,0 +1,2230 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecaptchaEnterprise + module V1 + # The create assessment request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which the assessment is created, + # in the format `projects/{project}`. + # @!attribute [rw] assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] + # Required. The assessment details. + class CreateAssessmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes an event in the lifecycle of a payment transaction. + # @!attribute [rw] event_type + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent::TransactionEventType] + # Optional. The type of this transaction event. + # @!attribute [rw] reason + # @return [::String] + # Optional. The reason or standardized code that corresponds with this + # transaction event, if one exists. For example, a CHARGEBACK event with code + # 6005. + # @!attribute [rw] value + # @return [::Float] + # Optional. The value that corresponds with this transaction event, if one + # exists. For example, a refund event where $5.00 was refunded. Currency is + # obtained from the original transaction data. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when this transaction event occurred; otherwise assumed + # to be the time of the API call. + class TransactionEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents an event in the payment transaction lifecycle. + # Ensure that applications can handle values not explicitly listed. + module TransactionEventType + # Default, unspecified event type. + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0 + + # Indicates that the transaction is approved by the merchant. The + # accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', + # 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_APPROVE = 1 + + # Indicates that the transaction is denied and concluded due to risks + # detected by the merchant. The accompanying reasons can include terms such + # as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_DENY = 2 + + # Indicates that the transaction is being evaluated by a human, due to + # suspicion or risk. + MANUAL_REVIEW = 3 + + # Indicates that the authorization attempt with the card issuer succeeded. + AUTHORIZATION = 4 + + # Indicates that the authorization attempt with the card issuer failed. + # The accompanying reasons can include Visa's '54' indicating that the card + # is expired, or '82' indicating that the CVV is incorrect. + AUTHORIZATION_DECLINE = 5 + + # Indicates that the transaction is completed because the funds were + # settled. + PAYMENT_CAPTURE = 6 + + # Indicates that the transaction could not be completed because the funds + # were not settled. + PAYMENT_CAPTURE_DECLINE = 7 + + # Indicates that the transaction has been canceled. Specify the reason + # for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. + CANCEL = 8 + + # Indicates that the merchant has received a chargeback inquiry due to + # fraud for the transaction, requesting additional information before a + # fraud chargeback is officially issued and a formal chargeback + # notification is sent. + CHARGEBACK_INQUIRY = 9 + + # Indicates that the merchant has received a chargeback alert due to fraud + # for the transaction. The process of resolving the dispute without + # involving the payment network is started. + CHARGEBACK_ALERT = 10 + + # Indicates that a fraud notification is issued for the transaction, sent + # by the payment instrument's issuing bank because the transaction appears + # to be fraudulent. We recommend including TC40 or SAFE data in the + # `reason` field for this event type. For partial chargebacks, we recommend + # that you include an amount in the `value` field. + FRAUD_NOTIFICATION = 11 + + # Indicates that the merchant is informed by the payment network that the + # transaction has entered the chargeback process due to fraud. Reason code + # examples include Discover's '6005' and '6041'. For partial chargebacks, + # we recommend that you include an amount in the `value` field. + CHARGEBACK = 12 + + # Indicates that the transaction has entered the chargeback process due to + # fraud, and that the merchant has chosen to enter representment. Reason + # examples include Discover's '6005' and '6041'. For partial chargebacks, + # we recommend that you include an amount in the `value` field. + CHARGEBACK_REPRESENTMENT = 13 + + # Indicates that the transaction has had a fraud chargeback which was + # illegitimate and was reversed as a result. For partial chargebacks, we + # recommend that you include an amount in the `value` field. + CHARGEBACK_REVERSE = 14 + + # Indicates that the merchant has received a refund for a completed + # transaction. For partial refunds, we recommend that you include an amount + # in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of + # exempt tax) + REFUND_REQUEST = 15 + + # Indicates that the merchant has received a refund request for this + # transaction, but that they have declined it. For partial refunds, we + # recommend that you include an amount in the `value` field. Reason + # example: 'TAX_EXEMPT' (partial refund of exempt tax) + REFUND_DECLINE = 16 + + # Indicates that the completed transaction was refunded by the merchant. + # For partial refunds, we recommend that you include an amount in the + # `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt + # tax) + REFUND = 17 + + # Indicates that the completed transaction was refunded by the merchant, + # and that this refund was reversed. For partial refunds, we recommend that + # you include an amount in the `value` field. + REFUND_REVERSE = 18 + end + end + + # Details on a phone authentication event + # @!attribute [rw] phone_number + # @return [::String] + # Required. Phone number in E.164 format for which a multi-factor + # authentication challenge was initiated, succeeded, or failed. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time at which the multi-factor authentication event + # (challenge or verification) occurred. + class PhoneAuthenticationEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to annotate an Assessment. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Assessment, in the format + # `projects/{project}/assessments/{assessment}`. + # @!attribute [rw] annotation + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation] + # Optional. The annotation that is assigned to the Event. This field can be + # left empty to provide reasons that apply to an event without concluding + # whether the event is legitimate or fraudulent. + # @!attribute [rw] reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>] + # Optional. Reasons for the annotation that are assigned to the event. + # @!attribute [rw] account_id + # @return [::String] + # Optional. A stable account identifier to apply to the assessment. This is + # an alternative to setting `account_id` in `CreateAssessment`, for example + # when a stable account identifier is not yet known in the initial request. + # @!attribute [rw] hashed_account_id + # @return [::String] + # Optional. A stable hashed account identifier to apply to the assessment. + # This is an alternative to setting `hashed_account_id` in + # `CreateAssessment`, for example when a stable account identifier is not yet + # known in the initial request. + # @!attribute [rw] transaction_event + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent] + # Optional. If the assessment is part of a payment transaction, provide + # details on payment lifecycle events that occur in the transaction. + # @!attribute [rw] phone_authentication_event + # @return [::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent] + # Optional. If using an external multi-factor authentication provider, + # provide phone authentication details for fraud detection purposes. + class AnnotateAssessmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the types of annotations. + module Annotation + # Default unspecified type. + ANNOTATION_UNSPECIFIED = 0 + + # Provides information that the event turned out to be legitimate. + LEGITIMATE = 1 + + # Provides information that the event turned out to be fraudulent. + FRAUDULENT = 2 + + # Provides information that the event was related to a login event in which + # the user typed the correct password. Deprecated, prefer indicating + # CORRECT_PASSWORD through the reasons field instead. + PASSWORD_CORRECT = 3 + + # Provides information that the event was related to a login event in which + # the user typed the incorrect password. Deprecated, prefer indicating + # INCORRECT_PASSWORD through the reasons field instead. + PASSWORD_INCORRECT = 4 + end + + # Enum that represents potential reasons for annotating an assessment. + module Reason + # Unspecified reason. Do not use. + REASON_UNSPECIFIED = 0 + + # Indicates that the transaction had a chargeback issued with no other + # details. When possible, specify the type by using CHARGEBACK_FRAUD or + # CHARGEBACK_DISPUTE instead. + CHARGEBACK = 1 + + # Indicates that the transaction had a chargeback issued related to an + # alleged unauthorized transaction from the cardholder's perspective (for + # example, the card number was stolen). + CHARGEBACK_FRAUD = 8 + + # Indicates that the transaction had a chargeback issued related to the + # cardholder having provided their card details but allegedly not being + # satisfied with the purchase (for example, misrepresentation, attempted + # cancellation). + CHARGEBACK_DISPUTE = 9 + + # Indicates that the completed payment transaction was refunded by the + # seller. + REFUND = 10 + + # Indicates that the completed payment transaction was determined to be + # fraudulent by the seller, and was cancelled and refunded as a result. + REFUND_FRAUD = 11 + + # Indicates that the payment transaction was accepted, and the user was + # charged. + TRANSACTION_ACCEPTED = 12 + + # Indicates that the payment transaction was declined, for example due to + # invalid card details. + TRANSACTION_DECLINED = 13 + + # Indicates the transaction associated with the assessment is suspected of + # being fraudulent based on the payment method, billing details, shipping + # address or other transaction information. + PAYMENT_HEURISTICS = 2 + + # Indicates that the user was served a 2FA challenge. An old assessment + # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + # This is equivalent to `FAILED_TWO_FACTOR`. + INITIATED_TWO_FACTOR = 7 + + # Indicates that the user passed a 2FA challenge. + PASSED_TWO_FACTOR = 3 + + # Indicates that the user failed a 2FA challenge. + FAILED_TWO_FACTOR = 4 + + # Indicates the user provided the correct password. + CORRECT_PASSWORD = 5 + + # Indicates the user provided an incorrect password. + INCORRECT_PASSWORD = 6 + + # Indicates that the user sent unwanted and abusive messages to other users + # of the platform, such as spam, scams, phishing, or social engineering. + SOCIAL_SPAM = 14 + end + end + + # Empty response for AnnotateAssessment. + class AnnotateAssessmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about a verification endpoint that can be used for 2FA. + # @!attribute [rw] email_address + # @return [::String] + # Email address for which to trigger a verification request. + # + # Note: The following fields are mutually exclusive: `email_address`, `phone_number`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] phone_number + # @return [::String] + # Phone number for which to trigger a verification request. Should be given + # in E.164 format. + # + # Note: The following fields are mutually exclusive: `phone_number`, `email_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] request_token + # @return [::String] + # Output only. Token to provide to the client to trigger endpoint + # verification. It must be used within 15 minutes. + # @!attribute [r] last_verification_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of the last successful verification for the + # endpoint, if any. + class EndpointVerificationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about account verification, used for identity verification. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::EndpointVerificationInfo>] + # Optional. Endpoints that can be used for identity verification. + # @!attribute [rw] language_code + # @return [::String] + # Optional. Language code preference for the verification message, set as a + # IETF BCP 47 language code. + # @!attribute [r] latest_verification_result + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountVerificationInfo::Result] + # Output only. Result of the latest account verification challenge. + # @!attribute [rw] username + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Username of the account that is being verified. Deprecated. Customers + # should now provide the `account_id` field in `event.user_info`. + class AccountVerificationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Result of the account verification as contained in the verdict token issued + # at the end of the verification flow. + # Ensure that applications can handle values not explicitly listed. + module Result + # No information about the latest account verification. + RESULT_UNSPECIFIED = 0 + + # The user was successfully verified. This means the account verification + # challenge was successfully completed. + SUCCESS_USER_VERIFIED = 1 + + # The user failed the verification challenge. + ERROR_USER_NOT_VERIFIED = 2 + + # The site is not properly onboarded to use the account verification + # feature. + ERROR_SITE_ONBOARDING_INCOMPLETE = 3 + + # The recipient is not allowed for account verification. This can occur + # during integration but should not occur in production. + ERROR_RECIPIENT_NOT_ALLOWED = 4 + + # The recipient has already been sent too many verification codes in a + # short amount of time. + ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5 + + # The verification flow could not be completed due to a critical internal + # error. + ERROR_CRITICAL_INTERNAL = 6 + + # The client has exceeded their two factor request quota for this period of + # time. + ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7 + + # The request cannot be processed at the time because of an incident. This + # bypass can be restricted to a problematic destination email domain, a + # customer, or could affect the entire service. + ERROR_VERIFICATION_BYPASSED = 8 + + # The request parameters do not match with the token provided and cannot be + # processed. + ERROR_VERDICT_MISMATCH = 9 + end + end + + # Private password leak verification info. + # @!attribute [rw] lookup_hash_prefix + # @return [::String] + # Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized + # username. It is used to look up password leaks associated with that hash + # prefix. + # @!attribute [rw] encrypted_user_credentials_hash + # @return [::String] + # Optional. Encrypted Scrypt hash of the canonicalized username+password. It + # is re-encrypted by the server and returned through + # `reencrypted_user_credentials_hash`. + # @!attribute [r] encrypted_leak_match_prefixes + # @return [::Array<::String>] + # Output only. List of prefixes of the encrypted potential password leaks + # that matched the given parameters. They must be compared with the + # client-side decryption prefix of `reencrypted_user_credentials_hash` + # @!attribute [r] reencrypted_user_credentials_hash + # @return [::String] + # Output only. Corresponds to the re-encryption of the + # `encrypted_user_credentials_hash` field. It is used to match potential + # password leaks within `encrypted_leak_match_prefixes`. + class PrivatePasswordLeakVerification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reCAPTCHA Enterprise assessment resource. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name for the Assessment in the format + # `projects/{project}/assessments/{assessment}`. + # @!attribute [rw] event + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Event] + # Optional. The event being assessed. + # @!attribute [r] risk_analysis + # @return [::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis] + # Output only. The risk analysis result for the event being assessed. + # @!attribute [r] token_properties + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TokenProperties] + # Output only. Properties of the provided event token. + # @!attribute [rw] account_verification + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountVerificationInfo] + # Optional. Account verification information for identity verification. The + # assessment event must include a token and site key to use this feature. + # @!attribute [r] account_defender_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountDefenderAssessment] + # Output only. Assessment returned by account defender when an account + # identifier is provided. + # @!attribute [rw] private_password_leak_verification + # @return [::Google::Cloud::RecaptchaEnterprise::V1::PrivatePasswordLeakVerification] + # Optional. The private password leak verification field contains the + # parameters that are used to to check for leaks privately without sharing + # user credentials. + # @!attribute [r] firewall_policy_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicyAssessment] + # Output only. Assessment returned when firewall policies belonging to the + # project are evaluated using the field firewall_policy_evaluation. + # @!attribute [r] fraud_prevention_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment] + # Output only. Assessment returned by Fraud Prevention when TransactionData + # is provided. + # @!attribute [r] fraud_signals + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals] + # Output only. Fraud Signals specific to the users involved in a payment + # transaction. + # @!attribute [r] phone_fraud_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::PhoneFraudAssessment] + # Output only. Assessment returned when a site key, a token, and a phone + # number as `user_id` are provided. Account defender and SMS toll fraud + # protection need to be enabled. + # @!attribute [rw] assessment_environment + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AssessmentEnvironment] + # Optional. The environment creating the assessment. This describes your + # environment (the system invoking CreateAssessment), NOT the environment of + # your user. + class Assessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The event being assessed. + # @!attribute [rw] token + # @return [::String] + # Optional. The user response token provided by the reCAPTCHA Enterprise + # client-side integration on your site. + # @!attribute [rw] site_key + # @return [::String] + # Optional. The site key that was used to invoke reCAPTCHA Enterprise on your + # site and generate the token. + # @!attribute [rw] user_agent + # @return [::String] + # Optional. The user agent present in the request from the user's device + # related to this event. + # @!attribute [rw] user_ip_address + # @return [::String] + # Optional. The IP address in the request from the user's device related to + # this event. + # @!attribute [rw] expected_action + # @return [::String] + # Optional. The expected action for this type of event. This should be the + # same action provided at token generation time on client-side platforms + # already integrated with recaptcha enterprise. + # @!attribute [rw] hashed_account_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Deprecated: use `user_info.account_id` instead. + # Unique stable hashed user identifier for the request. The identifier must + # be hashed using hmac-sha256 with stable secret. + # @!attribute [rw] express + # @return [::Boolean] + # Optional. Flag for a reCAPTCHA express request for an assessment without a + # token. If enabled, `site_key` must reference an Express site key. + # @!attribute [rw] requested_uri + # @return [::String] + # Optional. The URI resource the user requested that triggered an assessment. + # @!attribute [rw] waf_token_assessment + # @return [::Boolean] + # Optional. Flag for running Web Application Firewall (WAF) token assessment. + # If enabled, the token must be specified, and have been created by a + # WAF-enabled key. + # @!attribute [rw] ja3 + # @return [::String] + # Optional. JA3 fingerprint for SSL clients. To learn how to compute this + # fingerprint, please refer to https://github.com/salesforce/ja3. + # @!attribute [rw] ja4 + # @return [::String] + # Optional. JA4 fingerprint for SSL clients. To learn how to compute this + # fingerprint, please refer to https://github.com/FoxIO-LLC/ja4. + # @!attribute [rw] headers + # @return [::Array<::String>] + # Optional. HTTP header information about the request. + # @!attribute [rw] firewall_policy_evaluation + # @return [::Boolean] + # Optional. Flag for enabling firewall policy config assessment. + # If this flag is enabled, the firewall policy is evaluated and a + # suggested firewall action is returned in the response. + # @!attribute [rw] transaction_data + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData] + # Optional. Data describing a payment transaction to be assessed. Sending + # this data enables reCAPTCHA Enterprise Fraud Prevention and the + # FraudPreventionAssessment component in the response. + # @!attribute [rw] user_info + # @return [::Google::Cloud::RecaptchaEnterprise::V1::UserInfo] + # Optional. Information about the user that generates this event, when they + # can be identified. They are often identified through the use of an account + # for logged-in requests or login/registration requests, or by providing user + # identifiers for guest actions like checkout. + # @!attribute [rw] fraud_prevention + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Event::FraudPrevention] + # Optional. The Fraud Prevention setting for this assessment. + class Event + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Setting that controls Fraud Prevention assessments. + # Ensure that applications can handle values not explicitly listed. + module FraudPrevention + # Default, unspecified setting. `fraud_prevention_assessment` is returned + # if `transaction_data` is present in `Event` and Fraud Prevention is + # enabled in the Google Cloud console. + FRAUD_PREVENTION_UNSPECIFIED = 0 + + # Enable Fraud Prevention for this assessment, if Fraud Prevention is + # enabled in the Google Cloud console. + ENABLED = 1 + + # Disable Fraud Prevention for this assessment, regardless of the Google + # Cloud console settings. + DISABLED = 2 + end + end + + # Transaction data associated with a payment protected by reCAPTCHA Enterprise. + # @!attribute [rw] transaction_id + # @return [::String] + # Unique identifier for the transaction. This custom identifier can be used + # to reference this transaction in the future, for example, labeling a refund + # or chargeback event. Two attempts at the same transaction should use the + # same transaction id. + # @!attribute [rw] payment_method + # @return [::String] + # Optional. The payment method for the transaction. The allowed values are: + # + # * credit-card + # * debit-card + # * gift-card + # * processor-\\{name} (If a third-party is used, for example, + # processor-paypal) + # * custom-\\{name} (If an alternative method is used, for example, + # custom-crypto) + # @!attribute [rw] card_bin + # @return [::String] + # Optional. The Bank Identification Number - generally the first 6 or 8 + # digits of the card. + # @!attribute [rw] card_last_four + # @return [::String] + # Optional. The last four digits of the card. + # @!attribute [rw] currency_code + # @return [::String] + # Optional. The currency code in ISO-4217 format. + # @!attribute [rw] value + # @return [::Float] + # Optional. The decimal value of the transaction in the specified currency. + # @!attribute [rw] shipping_value + # @return [::Float] + # Optional. The value of shipping in the specified currency. 0 for free or no + # shipping. + # @!attribute [rw] shipping_address + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Address] + # Optional. Destination address if this transaction involves shipping a + # physical item. + # @!attribute [rw] billing_address + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Address] + # Optional. Address associated with the payment method when applicable. + # @!attribute [rw] user + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::User] + # Optional. Information about the user paying/initiating the transaction. + # @!attribute [rw] merchants + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::User>] + # Optional. Information about the user or users fulfilling the transaction. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Item>] + # Optional. Items purchased in this transaction. + # @!attribute [rw] gateway_info + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::GatewayInfo] + # Optional. Information about the payment gateway's response to the + # transaction. + class TransactionData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Structured address format for billing and shipping addresses. + # @!attribute [rw] recipient + # @return [::String] + # Optional. The recipient name, potentially including information such as + # "care of". + # @!attribute [rw] address + # @return [::Array<::String>] + # Optional. The first lines of the address. The first line generally + # contains the street name and number, and further lines may include + # information such as an apartment number. + # @!attribute [rw] locality + # @return [::String] + # Optional. The town/city of the address. + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. The state, province, or otherwise administrative area of the + # address. + # @!attribute [rw] region_code + # @return [::String] + # Optional. The CLDR country/region of the address. + # @!attribute [rw] postal_code + # @return [::String] + # Optional. The postal or ZIP code of the address. + class Address + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about a user's account involved in the transaction. + # @!attribute [rw] account_id + # @return [::String] + # Optional. Unique account identifier for this user. If using account + # defender, this should match the hashed_account_id field. Otherwise, a + # unique and persistent identifier for this account. + # @!attribute [rw] creation_ms + # @return [::Integer] + # Optional. The epoch milliseconds of the user's account creation. + # @!attribute [rw] email + # @return [::String] + # Optional. The email address of the user. + # @!attribute [rw] email_verified + # @return [::Boolean] + # Optional. Whether the email has been verified to be accessible by the + # user (OTP or similar). + # @!attribute [rw] phone_number + # @return [::String] + # Optional. The phone number of the user, with country code. + # @!attribute [rw] phone_verified + # @return [::Boolean] + # Optional. Whether the phone number has been verified to be accessible by + # the user (OTP or similar). + class User + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Line items being purchased in this transaction. + # @!attribute [rw] name + # @return [::String] + # Optional. The full name of the item. + # @!attribute [rw] value + # @return [::Float] + # Optional. The value per item that the user is paying, in the transaction + # currency, after discounts. + # @!attribute [rw] quantity + # @return [::Integer] + # Optional. The quantity of this item that is being purchased. + # @!attribute [rw] merchant_account_id + # @return [::String] + # Optional. When a merchant is specified, its corresponding account_id. + # Necessary to populate marketplace-style transactions. + class Item + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about the transaction from the gateway. + # @!attribute [rw] name + # @return [::String] + # Optional. Name of the gateway service (for example, stripe, square, + # paypal). + # @!attribute [rw] gateway_response_code + # @return [::String] + # Optional. Gateway response code describing the state of the transaction. + # @!attribute [rw] avs_response_code + # @return [::String] + # Optional. AVS response code from the gateway + # (available only when reCAPTCHA Enterprise is called after authorization). + # @!attribute [rw] cvv_response_code + # @return [::String] + # Optional. CVV response code from the gateway + # (available only when reCAPTCHA Enterprise is called after authorization). + class GatewayInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # User information associated with a request protected by reCAPTCHA Enterprise. + # @!attribute [rw] create_account_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Creation time for this account associated with this user. Leave + # blank for non logged-in actions, guest checkout, or when there is no + # account associated with the current user. + # @!attribute [rw] account_id + # @return [::String] + # Optional. For logged-in requests or login/registration requests, the unique + # account identifier associated with this user. You can use the username if + # it is stable (meaning it is the same for every request associated with the + # same user), or any stable user ID of your choice. Leave blank for non + # logged-in actions or guest checkout. + # @!attribute [rw] user_ids + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::UserId>] + # Optional. Identifiers associated with this user or request. + class UserInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An identifier associated with a user. + # @!attribute [rw] email + # @return [::String] + # Optional. An email address. + # + # Note: The following fields are mutually exclusive: `email`, `phone_number`, `username`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] phone_number + # @return [::String] + # Optional. A phone number. Should use the E.164 format. + # + # Note: The following fields are mutually exclusive: `phone_number`, `email`, `username`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] username + # @return [::String] + # Optional. A unique username, if different from all the other identifiers + # and `account_id` that are provided. Can be a unique login handle or + # display name for a user. + # + # Note: The following fields are mutually exclusive: `username`, `email`, `phone_number`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class UserId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Risk analysis result for an event. + # @!attribute [r] score + # @return [::Float] + # Output only. Legitimate event score from 0.0 to 1.0. + # (1.0 means very likely legitimate traffic while 0.0 means very likely + # non-legitimate traffic). + # @!attribute [r] reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis::ClassificationReason>] + # Output only. Reasons contributing to the risk analysis verdict. + # @!attribute [r] extended_verdict_reasons + # @return [::Array<::String>] + # Output only. Extended verdict reasons to be used for experimentation only. + # The set of possible reasons is subject to change. + # @!attribute [r] challenge + # @return [::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis::Challenge] + # Output only. Challenge information for POLICY_BASED_CHALLENGE and INVISIBLE + # keys. + # @!attribute [r] verified_bots + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::Bot>] + # Output only. Bots with identities that have been verified by reCAPTCHA and + # detected in the event. + class RiskAnalysis + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reasons contributing to the risk analysis verdict. + # Ensure that applications can handle values not explicitly listed. + module ClassificationReason + # Default unspecified type. + CLASSIFICATION_REASON_UNSPECIFIED = 0 + + # Interactions matched the behavior of an automated agent. + AUTOMATION = 1 + + # The event originated from an illegitimate environment. + UNEXPECTED_ENVIRONMENT = 2 + + # Traffic volume from the event source is higher than normal. + TOO_MUCH_TRAFFIC = 3 + + # Interactions with the site were significantly different than expected + # patterns. + UNEXPECTED_USAGE_PATTERNS = 4 + + # Too little traffic has been received from this site thus far to generate + # quality risk analysis. + LOW_CONFIDENCE_SCORE = 5 + + # The request matches behavioral characteristics of a carding attack. + SUSPECTED_CARDING = 6 + + # The request matches behavioral characteristics of chargebacks for fraud. + SUSPECTED_CHARGEBACK = 7 + end + + # Challenge information for POLICY_BASED_CHALLENGE and INVISIBLE keys. + # Ensure that applications can handle values not explicitly listed. + module Challenge + # Default unspecified type. + CHALLENGE_UNSPECIFIED = 0 + + # No challenge was presented for solving. + NOCAPTCHA = 1 + + # A solution was submitted that was correct. + PASSED = 2 + + # A solution was submitted that was incorrect or otherwise + # deemed suspicious. + FAILED = 3 + end + end + + # Bot information and metadata. + # @!attribute [rw] name + # @return [::String] + # Optional. Enumerated string value that indicates the identity of the bot, + # formatted in kebab-case. + # @!attribute [rw] bot_type + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Bot::BotType] + # Optional. Enumerated field representing the type of bot. + class Bot + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of bots. + # Ensure that applications can handle values not explicitly listed. + module BotType + # Default unspecified type. + BOT_TYPE_UNSPECIFIED = 0 + + # Software program that interacts with a site and performs tasks + # autonomously. + AI_AGENT = 1 + + # Software that extracts specific data from sites for use. + CONTENT_SCRAPER = 2 + + # Software that crawls sites and stores content for the purpose of + # efficient retrieval, likely as part of a search engine. + SEARCH_INDEXER = 3 + end + end + + # Properties of the provided event token. + # @!attribute [r] valid + # @return [::Boolean] + # Output only. Whether the provided user response token is valid. When valid + # = false, the reason could be specified in invalid_reason or it could also + # be due to a user failing to solve a challenge or a sitekey mismatch (i.e + # the sitekey used to generate the token was different than the one specified + # in the assessment). + # @!attribute [r] invalid_reason + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TokenProperties::InvalidReason] + # Output only. Reason associated with the response when valid = false. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp corresponding to the generation of the token. + # @!attribute [r] hostname + # @return [::String] + # Output only. The hostname of the page on which the token was generated (Web + # keys only). + # @!attribute [r] android_package_name + # @return [::String] + # Output only. The name of the Android package with which the token was + # generated (Android keys only). + # @!attribute [r] ios_bundle_id + # @return [::String] + # Output only. The ID of the iOS bundle with which the token was generated + # (iOS keys only). + # @!attribute [r] action + # @return [::String] + # Output only. Action name provided at token generation. + class TokenProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the types of invalid token reasons. + # Ensure that applications can handle values not explicitly listed. + module InvalidReason + # Default unspecified type. + INVALID_REASON_UNSPECIFIED = 0 + + # If the failure reason was not accounted for. + UNKNOWN_INVALID_REASON = 1 + + # The provided user verification token was malformed. + MALFORMED = 2 + + # The user verification token had expired. + EXPIRED = 3 + + # The user verification had already been seen. + DUPE = 4 + + # The user verification token was not present. + MISSING = 5 + + # A retriable error (such as network failure) occurred on the browser. + # Could easily be simulated by an attacker. + BROWSER_ERROR = 6 + + # The action provided at token generation was different than + # the `expected_action` in the assessment request. The comparison is + # case-insensitive. This reason can only be returned if all of the + # following are true: + # + # - your `site_key` has the POLICY_BASED_CHALLENGE integration type + # - you set an action score threshold higher than 0.0 + # - you provided a non-empty `expected_action` + UNEXPECTED_ACTION = 7 + end + end + + # Assessment for Fraud Prevention. + # @!attribute [r] transaction_risk + # @return [::Float] + # Output only. Probability of this transaction being fraudulent. Summarizes + # the combined risk of attack vectors below. Values are from 0.0 (lowest) + # to 1.0 (highest). + # @!attribute [r] risk_reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::RiskReason>] + # Output only. Reasons why the transaction is probably fraudulent and + # received a high transaction risk score. + # @!attribute [r] stolen_instrument_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::StolenInstrumentVerdict] + # Output only. Assessment of this transaction for risk of a stolen + # instrument. + # @!attribute [r] card_testing_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::CardTestingVerdict] + # Output only. Assessment of this transaction for risk of being part of a + # card testing attack. + # @!attribute [r] behavioral_trust_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::BehavioralTrustVerdict] + # Output only. Assessment of this transaction for behavioral trust. + class FraudPreventionAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Risk reasons applicable to the Fraud Prevention assessment. + # @!attribute [r] reason + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::RiskReason::Reason] + # Output only. Risk reasons applicable to the Fraud Prevention assessment. + class RiskReason + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Risk reasons applicable to the Fraud Prevention assessment. New risk + # reasons will be added over time. + module Reason + # Default unspecified type. + REASON_UNSPECIFIED = 0 + + # A suspiciously high number of recent transactions have used identifiers + # present in this transaction. + HIGH_TRANSACTION_VELOCITY = 1 + + # User is cycling through a suspiciously large number of identifiers, + # suggesting enumeration or validation attacks within a potential fraud + # network. + EXCESSIVE_ENUMERATION_PATTERN = 2 + + # User has a short history or no history in the reCAPTCHA network, + # suggesting the possibility of synthetic identity generation. + SHORT_IDENTITY_HISTORY = 3 + + # Identifiers used in this transaction originate from an unusual or + # conflicting set of geolocations. + GEOLOCATION_DISCREPANCY = 4 + + # This transaction is linked to a cluster of known fraudulent activity. + ASSOCIATED_WITH_FRAUD_CLUSTER = 5 + end + end + + # Information about stolen instrument fraud, where the user is not the + # legitimate owner of the instrument being used for the purchase. + # @!attribute [r] risk + # @return [::Float] + # Output only. Probability of this transaction being executed with a stolen + # instrument. Values are from 0.0 (lowest) to 1.0 (highest). + class StolenInstrumentVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about card testing fraud, where an adversary is testing + # fraudulently obtained cards or brute forcing their details. + # @!attribute [r] risk + # @return [::Float] + # Output only. Probability of this transaction attempt being part of a card + # testing attack. Values are from 0.0 (lowest) to 1.0 (highest). + class CardTestingVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about behavioral trust of the transaction. + # @!attribute [r] trust + # @return [::Float] + # Output only. Probability of this transaction attempt being executed in a + # behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 + # (highest). + class BehavioralTrustVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Fraud signals describing users and cards involved in the transaction. + # @!attribute [r] user_signals + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::UserSignals] + # Output only. Signals describing the end user in this transaction. + # @!attribute [r] card_signals + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::CardSignals] + # Output only. Signals describing the payment card or cards used in this + # transaction. + class FraudSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Signals describing the user involved in this transaction. + # @!attribute [r] active_days_lower_bound + # @return [::Integer] + # Output only. This user (based on email, phone, and other identifiers) has + # been seen on the internet for at least this number of days. + # @!attribute [r] synthetic_risk + # @return [::Float] + # Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic + # components in their identity, such as a randomly generated email address, + # temporary phone number, or fake shipping address. + class UserSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Signals describing the payment card used in this transaction. + # @!attribute [r] card_labels + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::CardSignals::CardLabel>] + # Output only. The labels for the payment card in this transaction. + class CardSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Risk labels describing the card being assessed, such as its funding + # mechanism. + # Ensure that applications can handle values not explicitly listed. + module CardLabel + # No label specified. + CARD_LABEL_UNSPECIFIED = 0 + + # This card has been detected as prepaid. + PREPAID = 1 + + # This card has been detected as virtual, such as a card number generated + # for a single transaction or merchant. + VIRTUAL = 2 + + # This card has been detected as being used in an unexpected geographic + # location. + UNEXPECTED_LOCATION = 3 + end + end + end + + # Information about SMS toll fraud. + # @!attribute [r] risk + # @return [::Float] + # Output only. Probability of an SMS event being fraudulent. + # Values are from 0.0 (lowest) to 1.0 (highest). + # @!attribute [r] reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::SmsTollFraudVerdict::SmsTollFraudReason>] + # Output only. Reasons contributing to the SMS toll fraud verdict. + class SmsTollFraudVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reasons contributing to the SMS toll fraud verdict. + # Ensure that applications can handle values not explicitly listed. + module SmsTollFraudReason + # Default unspecified reason + SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0 + + # The provided phone number was invalid + INVALID_PHONE_NUMBER = 1 + end + end + + # Assessment for Phone Fraud + # @!attribute [r] sms_toll_fraud_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1::SmsTollFraudVerdict] + # Output only. Assessment of this phone event for risk of SMS toll fraud. + class PhoneFraudAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Account defender risk assessment. + # @!attribute [r] labels + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AccountDefenderAssessment::AccountDefenderLabel>] + # Output only. Labels for this request. + class AccountDefenderAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Labels returned by account defender for this request. + # Ensure that applications can handle values not explicitly listed. + module AccountDefenderLabel + # Default unspecified type. + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0 + + # The request matches a known good profile for the user. + PROFILE_MATCH = 1 + + # The request is potentially a suspicious login event and must be further + # verified either through multi-factor authentication or another system. + SUSPICIOUS_LOGIN_ACTIVITY = 2 + + # The request matched a profile that previously had suspicious account + # creation behavior. This can mean that this is a fake account. + SUSPICIOUS_ACCOUNT_CREATION = 3 + + # The account in the request has a high number of related accounts. It does + # not necessarily imply that the account is bad but can require further + # investigation. + RELATED_ACCOUNTS_NUMBER_HIGH = 4 + end + end + + # The create key request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which the key is created, in the + # format `projects/{project}`. + # @!attribute [rw] key + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # Required. Information to create a reCAPTCHA Enterprise key. + class CreateKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The list keys request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project that contains the keys that is + # listed, in the format `projects/{project}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of keys to return. Default is 10. Max limit is + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous. + # ListKeysRequest, if any. + class ListKeysRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to request to list keys in a project. + # @!attribute [rw] keys + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::Key>] + # Key details. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results. It is set to empty if no keys + # remain in results. + class ListKeysResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The retrieve legacy secret key request message. + # @!attribute [rw] key + # @return [::String] + # Required. The public key name linked to the requested secret key in the + # format `projects/{project}/keys/{key}`. + class RetrieveLegacySecretKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The get key request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested key, in the format + # `projects/{project}/keys/{key}`. + class GetKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The update key request message. + # @!attribute [rw] key + # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] + # Required. The key to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields of the key get updated. If the + # mask is not present, all fields are updated. + class UpdateKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The delete key request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the key to be deleted, in the format + # `projects/{project}/keys/{key}`. + class DeleteKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The create firewall policy request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project this policy applies to, in the format + # `projects/{project}`. + # @!attribute [rw] firewall_policy + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # Required. Information to create the policy. + class CreateFirewallPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The list firewall policies request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project to list the policies for, in the format + # `projects/{project}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policies to return. Default is 10. Max + # limit is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous. + # ListFirewallPoliciesRequest, if any. + class ListFirewallPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to request to list firewall policies belonging to a project. + # @!attribute [rw] firewall_policies + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] + # Policy details. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results. It is set to empty if no + # policies remain in results. + class ListFirewallPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The get firewall policy request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested policy, in the format + # `projects/{project}/firewallpolicies/{firewallpolicy}`. + class GetFirewallPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The update firewall policy request message. + # @!attribute [rw] firewall_policy + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # Required. The policy to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields of the policy get updated. If + # the mask is not present, all fields are updated. + class UpdateFirewallPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The delete firewall policy request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the policy to be deleted, in the format + # `projects/{project}/firewallpolicies/{firewallpolicy}`. + class DeleteFirewallPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The reorder firewall policies request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project to list the policies for, in the format + # `projects/{project}`. + # @!attribute [rw] names + # @return [::Array<::String>] + # Required. A list containing all policy names, in the new order. Each name + # is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. + class ReorderFirewallPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The reorder firewall policies response message. + class ReorderFirewallPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The migrate key request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the key to be migrated, in the format + # `projects/{project}/keys/{key}`. + # @!attribute [rw] skip_billing_check + # @return [::Boolean] + # Optional. If true, skips the billing check. + # A reCAPTCHA Enterprise key or migrated key behaves differently than a + # reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see + # https://docs.cloud.google.com/recaptcha/quotas#quota_limit). To avoid + # any disruption of your usage, we check that a billing account is present. + # If your usage of reCAPTCHA is under the free quota, you can safely skip the + # billing check and proceed with the migration. See + # https://cloud.google.com/recaptcha/docs/billing-information. + class MigrateKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The get metrics request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the requested metrics, in the format + # `projects/{project}/keys/{key}/metrics`. + class GetMetricsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metrics for a single Key. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The name of the metrics, in the format + # `projects/{project}/keys/{key}/metrics`. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Inclusive start time aligned to a day in the America/Los_Angeles (Pacific) + # timezone. + # @!attribute [rw] score_metrics + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ScoreMetrics>] + # Metrics are continuous and in order by dates, and in the granularity + # of day. All Key types should have score-based data. + # @!attribute [rw] challenge_metrics + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ChallengeMetrics>] + # Metrics are continuous and in order by dates, and in the granularity + # of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have + # challenge-based data. + class Metrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Secret key is used only in legacy reCAPTCHA. It must be used in a 3rd party + # integration with legacy reCAPTCHA. + # @!attribute [rw] legacy_secret_key + # @return [::String] + # The secret key (also known as shared secret) authorizes communication + # between your application backend and the reCAPTCHA Enterprise server to + # create an assessment. + # The secret key needs to be kept safe for security purposes. + class RetrieveLegacySecretKeyResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A key used to identify and configure applications (web and/or mobile) that + # use reCAPTCHA Enterprise. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for the Key in the format + # `projects/{project}/keys/{key}`. + # @!attribute [rw] display_name + # @return [::String] + # Required. Human-readable display name of this key. Modifiable by user. + # @!attribute [rw] web_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings] + # Settings for keys that can be used by websites. + # + # Note: The following fields are mutually exclusive: `web_settings`, `android_settings`, `ios_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] android_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AndroidKeySettings] + # Settings for keys that can be used by Android apps. + # + # Note: The following fields are mutually exclusive: `android_settings`, `web_settings`, `ios_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ios_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::IOSKeySettings] + # Settings for keys that can be used by iOS apps. + # + # Note: The following fields are mutually exclusive: `ios_settings`, `web_settings`, `android_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] express_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::ExpressKeySettings] + # Settings for keys that can be used by reCAPTCHA Express. + # + # Note: The following fields are mutually exclusive: `express_settings`, `web_settings`, `android_settings`, `ios_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. See [Creating and managing labels] + # (https://cloud.google.com/recaptcha/docs/labels). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp corresponding to the creation of this key. + # @!attribute [rw] testing_options + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions] + # Optional. Options for user acceptance testing. + # @!attribute [rw] waf_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings] + # Optional. Settings for Web Application Firewall (WAF). + class Key + 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 + + # Options for user acceptance testing. + # @!attribute [rw] testing_score + # @return [::Float] + # Optional. All assessments for this Key return this score. Must be between 0 + # (likely not legitimate) and 1 (likely legitimate) inclusive. + # @!attribute [rw] testing_challenge + # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions::TestingChallenge] + # Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all + # challenge requests for this site return nocaptcha if NOCAPTCHA, or an + # unsolvable challenge if CHALLENGE. + class TestingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the challenge option for challenge-based (for example, + # CHECKBOX and INVISIBLE) testing keys. + # Ensure that applications can handle values not explicitly listed. + module TestingChallenge + # Perform the normal risk analysis and return either nocaptcha or a + # challenge depending on risk and trust factors. + TESTING_CHALLENGE_UNSPECIFIED = 0 + + # Challenge requests for this key always return a nocaptcha, which + # does not require a solution. + NOCAPTCHA = 1 + + # Challenge requests for this key always return an unsolvable + # challenge. + UNSOLVABLE_CHALLENGE = 2 + end + end + + # Settings specific to keys that can be used by websites. + # @!attribute [rw] allow_all_domains + # @return [::Boolean] + # Optional. If set to true, it means allowed_domains are not enforced. + # @!attribute [rw] allowed_domains + # @return [::Array<::String>] + # Optional. Domains or subdomains of websites allowed to use the key. All + # subdomains of an allowed domain are automatically allowed. A valid domain + # requires a host and must not include any path, port, query or fragment. + # Examples: 'example.com' or 'subdomain.example.com' + # Each key supports a maximum of 250 domains. To use a key on more domains, + # set `allow_all_domains` to true. When this is set, you are responsible for + # validating the hostname by checking the `token_properties.hostname` field + # in each assessment response against your list of allowed domains. + # @!attribute [rw] allow_amp_traffic + # @return [::Boolean] + # Optional. If set to true, the key can be used on AMP (Accelerated Mobile + # Pages) websites. This is supported only for the SCORE integration type. + # @!attribute [rw] integration_type + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::IntegrationType] + # Required. Describes how this key is integrated with the website. + # @!attribute [rw] challenge_security_preference + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ChallengeSecurityPreference] + # Optional. Settings for the frequency and difficulty at which this key + # triggers captcha challenges. This should only be specified for + # `IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE. + # @!attribute [rw] challenge_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ChallengeSettings] + # Optional. Challenge settings. + class WebKeySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Per-action challenge settings. + # @!attribute [rw] score_threshold + # @return [::Float] + # Required. A challenge is triggered if the end-user score is below that + # threshold. Value must be between 0 and 1 (inclusive). + class ActionSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for POLICY_BASED_CHALLENGE keys to control when a challenge is + # triggered. + # @!attribute [rw] default_settings + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings] + # Required. Defines when a challenge is triggered (unless the default + # threshold is overridden for the given action, see `action_settings`). + # @!attribute [rw] action_settings + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings}] + # Optional. The action to score threshold map. + # The action name should be the same as the action name passed in the + # `data-action` attribute + # (see https://cloud.google.com/recaptcha/docs/actions-website). + # Action names are case-insensitive. + # There is a maximum of 100 action settings. + # An action name has a maximum length of 100. + class ChallengeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings] + class ActionSettingsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Enum that represents the integration types for web keys. + # Ensure that applications can handle values not explicitly listed. + module IntegrationType + # Default type that indicates this enum hasn't been specified. This is not + # a valid IntegrationType, one of the other types must be specified + # instead. + INTEGRATION_TYPE_UNSPECIFIED = 0 + + # Only used to produce scores. It doesn't display the "I'm not a robot" + # checkbox and never shows captcha challenges. + SCORE = 1 + + # Displays the "I'm not a robot" checkbox and may show captcha challenges + # after it is checked. + CHECKBOX = 2 + + # Doesn't display the "I'm not a robot" checkbox, but may show captcha + # challenges after risk analysis. + INVISIBLE = 3 + + # Displays a visual challenge or not depending on the user risk analysis + # score. + POLICY_BASED_CHALLENGE = 5 + end + + # Enum that represents the possible challenge frequency and difficulty + # configurations for a web key. + # Ensure that applications can handle values not explicitly listed. + module ChallengeSecurityPreference + # Default type that indicates this enum hasn't been specified. + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0 + + # Key tends to show fewer and easier challenges. + USABILITY = 1 + + # Key tends to show balanced (in amount and difficulty) challenges. + BALANCE = 2 + + # Key tends to show more and harder challenges. + SECURITY = 3 + end + end + + # Settings specific to keys that can be used by Android apps. + # @!attribute [rw] allow_all_package_names + # @return [::Boolean] + # Optional. If set to true, allowed_package_names are not enforced. + # @!attribute [rw] allowed_package_names + # @return [::Array<::String>] + # Optional. Android package names of apps allowed to use the key. + # Example: 'com.companyname.appname' + # Each key supports a maximum of 250 package names. To use a key on more + # apps, set `allow_all_package_names` to true. When this is set, you + # are responsible for validating the package name by checking the + # `token_properties.android_package_name` field in each assessment response + # against your list of allowed package names. + # @!attribute [rw] support_non_google_app_store_distribution + # @return [::Boolean] + # Optional. Set to true for keys that are used in an Android application that + # is available for download in app stores in addition to the Google Play + # Store. + class AndroidKeySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings specific to keys that can be used by iOS apps. + # @!attribute [rw] allow_all_bundle_ids + # @return [::Boolean] + # Optional. If set to true, allowed_bundle_ids are not enforced. + # @!attribute [rw] allowed_bundle_ids + # @return [::Array<::String>] + # Optional. iOS bundle IDs of apps allowed to use the key. + # Example: 'com.companyname.productname.appname' + # Each key supports a maximum of 250 bundle IDs. To use a key on more + # apps, set `allow_all_bundle_ids` to true. When this is set, you + # are responsible for validating the bundle id by checking the + # `token_properties.ios_bundle_id` field in each assessment response + # against your list of allowed bundle IDs. + # @!attribute [rw] apple_developer_id + # @return [::Google::Cloud::RecaptchaEnterprise::V1::AppleDeveloperId] + # Optional. Apple Developer account details for the app that is protected by + # the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple + # App Attest and Apple DeviceCheck to protect your app from abuse. Providing + # these fields allows reCAPTCHA to get a better assessment of the integrity + # of your app. + class IOSKeySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings specific to keys that can be used for reCAPTCHA Express. + class ExpressKeySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains fields that are required to perform Apple-specific integrity checks. + # @!attribute [rw] private_key + # @return [::String] + # Required. Input only. A private key (downloaded as a text file with a .p8 + # file extension) generated for your Apple Developer account. Ensure that + # Apple DeviceCheck is enabled for the private key. + # @!attribute [rw] key_id + # @return [::String] + # Required. The Apple developer key ID (10-character string). + # @!attribute [rw] team_id + # @return [::String] + # Required. The Apple team ID (10-character string) owning the provisioning + # profile used to build your application. + class AppleDeveloperId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Score distribution. + # @!attribute [rw] score_buckets + # @return [::Google::Protobuf::Map{::Integer => ::Integer}] + # Map key is score value multiplied by 100. The scores are discrete values + # between [0, 1]. The maximum number of buckets is on order of a few dozen, + # but typically much lower (ie. 10). + class ScoreDistribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::Integer] + # @!attribute [rw] value + # @return [::Integer] + class ScoreBucketsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metrics related to scoring. + # @!attribute [rw] overall_metrics + # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution] + # Aggregated score metrics for all traffic. + # @!attribute [rw] action_metrics + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution}] + # Action-based metrics. The map key is the action name which specified by the + # site owners at time of the "execute" client-side call. + class ScoreMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution] + class ActionMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metrics related to challenges. + # @!attribute [rw] pageload_count + # @return [::Integer] + # Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + # to a count of pageloads for pages that include reCAPTCHA. + # @!attribute [rw] nocaptcha_count + # @return [::Integer] + # Count of nocaptchas (successful verification without a challenge) issued. + # @!attribute [rw] failed_count + # @return [::Integer] + # Count of submitted challenge solutions that were incorrect or otherwise + # deemed suspicious such that a subsequent challenge was triggered. + # @!attribute [rw] passed_count + # @return [::Integer] + # Count of nocaptchas (successful verification without a challenge) plus + # submitted challenge solutions that were correct and resulted in + # verification. + class ChallengeMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Policy config assessment. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. If the processing of a policy config fails, an error is + # populated and the firewall_policy is left empty. + # @!attribute [r] firewall_policy + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] + # Output only. The policy that matched the request. If more than one policy + # may match, this is the first match. If no policy matches the incoming + # request, the policy field is left empty. + class FirewallPolicyAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An individual action. Each action represents what to do if a policy + # matches. + # @!attribute [rw] allow + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::AllowAction] + # The user request did not match any policy and should be allowed + # access to the requested resource. + # + # Note: The following fields are mutually exclusive: `allow`, `block`, `include_recaptcha_script`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] block + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::BlockAction] + # This action denies access to a given page. The user gets an HTTP + # error code. + # + # Note: The following fields are mutually exclusive: `block`, `allow`, `include_recaptcha_script`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] include_recaptcha_script + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::IncludeRecaptchaScriptAction] + # This action injects reCAPTCHA JavaScript code into the HTML page + # returned by the site backend. + # + # Note: The following fields are mutually exclusive: `include_recaptcha_script`, `allow`, `block`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] redirect + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::RedirectAction] + # This action redirects the request to a reCAPTCHA interstitial to + # attach a token. + # + # Note: The following fields are mutually exclusive: `redirect`, `allow`, `block`, `include_recaptcha_script`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] substitute + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::SubstituteAction] + # This action transparently serves a different page to an offending + # user. + # + # Note: The following fields are mutually exclusive: `substitute`, `allow`, `block`, `include_recaptcha_script`, `redirect`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] set_header + # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::SetHeaderAction] + # This action sets a custom header but allow the request to continue + # to the customer backend. + # + # Note: The following fields are mutually exclusive: `set_header`, `allow`, `block`, `include_recaptcha_script`, `redirect`, `substitute`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class FirewallAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An allow action continues processing a request unimpeded. + class AllowAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A block action serves an HTTP error code a prevents the request from + # hitting the backend. + class BlockAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An include reCAPTCHA script action involves injecting reCAPTCHA JavaScript + # code into the HTML returned by the site backend. This reCAPTCHA + # script is tasked with collecting user signals on the requested web page, + # issuing tokens as a cookie within the site domain, and enabling their + # utilization in subsequent page requests. + class IncludeRecaptchaScriptAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A redirect action returns a 307 (temporary redirect) response, pointing + # the user to a reCAPTCHA interstitial page to attach a token. + class RedirectAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A substitute action transparently serves a different page than the one + # requested. + # @!attribute [rw] path + # @return [::String] + # Optional. The address to redirect to. The target is a relative path in + # the current host. Example: "/blog/404.html". + class SubstituteAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set header action sets a header and forwards the request to the + # backend. This can be used to trigger custom protection implemented on the + # backend. + # @!attribute [rw] key + # @return [::String] + # Optional. The header key to set in the request to the backend server. + # @!attribute [rw] value + # @return [::String] + # Optional. The header value to set in the request to the backend server. + class SetHeaderAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A FirewallPolicy represents a single matching pattern and resulting actions + # to take. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name for the FirewallPolicy in the format + # `projects/{project}/firewallpolicies/{firewallpolicy}`. + # @!attribute [rw] description + # @return [::String] + # Optional. A description of what this policy aims to achieve, for + # convenience purposes. The description can at most include 256 UTF-8 + # characters. + # @!attribute [rw] path + # @return [::String] + # Optional. The path for which this policy applies, specified as a glob + # pattern. For more information on glob, see the [manual + # page](https://man7.org/linux/man-pages/man7/glob.7.html). + # A path has a max length of 200 characters. + # @!attribute [rw] condition + # @return [::String] + # Optional. A CEL (Common Expression Language) conditional expression that + # specifies if this policy applies to an incoming user request. If this + # condition evaluates to true and the requested path matched the path + # pattern, the associated actions should be executed by the caller. The + # condition string is checked for CEL syntax correctness on creation. For + # more information, see the [CEL spec](https://github.com/google/cel-spec) + # and its [language + # definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + # A condition has a max length of 500 characters. + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction>] + # Optional. The actions that the caller should take regarding user access. + # There should be at most one terminal action. A terminal action is any + # action that forces a response, such as `AllowAction`, + # `BlockAction` or `SubstituteAction`. + # Zero or more non-terminal actions such as `SetHeader` might be + # specified. A single policy can contain up to 16 actions. + class FirewallPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to list memberships in a related account group. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name for the related account group in the format + # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of accounts to return. The service might + # return fewer than this value. If unspecified, at most 50 accounts are + # returned. The maximum value is 1000; values above 1000 are coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListRelatedAccountGroupMemberships` call. + # + # When paginating, all other parameters provided to + # `ListRelatedAccountGroupMemberships` must match the call that provided the + # page token. + class ListRelatedAccountGroupMembershipsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to a `ListRelatedAccountGroupMemberships` call. + # @!attribute [rw] related_account_group_memberships + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # The memberships listed by the query. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListRelatedAccountGroupMembershipsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to list related account groups. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project to list related account groups from, in + # the format `projects/{project}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of groups to return. The service might return + # fewer than this value. If unspecified, at most 50 groups are returned. The + # maximum value is 1000; values above 1000 are coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListRelatedAccountGroups` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListRelatedAccountGroups` must match the call that provided the page + # token. + class ListRelatedAccountGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to a `ListRelatedAccountGroups` call. + # @!attribute [rw] related_account_groups + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] + # The groups of related accounts listed by the query. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListRelatedAccountGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message to search related account group memberships. + # @!attribute [rw] project + # @return [::String] + # Required. The name of the project to search related account group + # memberships from. Specify the project name in the following format: + # `projects/{project}`. + # @!attribute [rw] account_id + # @return [::String] + # Optional. The unique stable account identifier used to search connections. + # The identifier should correspond to an `account_id` provided in a previous + # `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id + # or account_id must be set, but not both. + # @!attribute [rw] hashed_account_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Deprecated: use `account_id` instead. + # The unique stable hashed account identifier used to search connections. The + # identifier should correspond to a `hashed_account_id` provided in a + # previous `CreateAssessment` or `AnnotateAssessment` call. Either + # hashed_account_id or account_id must be set, but not both. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of groups to return. The service might return + # fewer than this value. If unspecified, at most 50 groups are returned. The + # maximum value is 1000; values above 1000 are coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `SearchRelatedAccountGroupMemberships` must match the call that provided + # the page token. + class SearchRelatedAccountGroupMembershipsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to a `SearchRelatedAccountGroupMemberships` call. + # @!attribute [rw] related_account_group_memberships + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] + # The queried memberships. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class SearchRelatedAccountGroupMembershipsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The AddIpOverride request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the key to which the IP override is added, in the + # format `projects/{project}/keys/{key}`. + # @!attribute [rw] ip_override_data + # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData] + # Required. IP override added to the key. + class AddIpOverrideRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for AddIpOverride. + class AddIpOverrideResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The RemoveIpOverride request message. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the key from which the IP override is removed, in the + # format `projects/{project}/keys/{key}`. + # @!attribute [rw] ip_override_data + # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData] + # Required. IP override to be removed from the key. + class RemoveIpOverrideRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for RemoveIpOverride. + class RemoveIpOverrideResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The ListIpOverrides request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent key for which the IP overrides are listed, in the + # format `projects/{project}/keys/{key}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of overrides to return. Default is 10. Max + # limit is 100. If the number of overrides is less than the page_size, all + # overrides are returned. If the page size is more than 100, it is coerced to + # 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous + # ListIpOverridesRequest, if any. + class ListIpOverridesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListIpOverrides. + # @!attribute [rw] ip_overrides + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] + # IP Overrides details. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results. If this field is empty, no keys + # remain in the results. + class ListIpOverridesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A membership in a group of related accounts. + # @!attribute [rw] name + # @return [::String] + # Required. Identifier. The resource name for this membership in the format + # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + # @!attribute [rw] account_id + # @return [::String] + # The unique stable account identifier of the member. The identifier + # corresponds to an `account_id` provided in a previous `CreateAssessment` or + # `AnnotateAssessment` call. + # @!attribute [rw] hashed_account_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated: use `account_id` instead. + # The unique stable hashed account identifier of the member. The identifier + # corresponds to a `hashed_account_id` provided in a previous + # `CreateAssessment` or `AnnotateAssessment` call. + class RelatedAccountGroupMembership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A group of related accounts. + # @!attribute [rw] name + # @return [::String] + # Required. Identifier. The resource name for the related account group in + # the format + # `projects/{project}/relatedaccountgroups/{related_account_group}`. + class RelatedAccountGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings specific to keys that can be used for WAF (Web Application + # Firewall). + # @!attribute [rw] waf_service + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings::WafService] + # Required. The Web Application Firewall (WAF) service that uses this key. + # @!attribute [rw] waf_feature + # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings::WafFeature] + # Required. The Web Application Firewall (WAF) feature for which this key is + # enabled. + class WafSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Supported WAF features. For more information, see + # https://cloud.google.com/recaptcha/docs/usecase#comparison_of_features. + # Ensure that applications can handle values not explicitly listed. + module WafFeature + # Undefined feature. + WAF_FEATURE_UNSPECIFIED = 0 + + # Redirects suspicious traffic to reCAPTCHA. + CHALLENGE_PAGE = 1 + + # Use reCAPTCHA session-tokens to protect the whole user session on the + # site's domain. + SESSION_TOKEN = 2 + + # Use reCAPTCHA action-tokens to protect user actions. + ACTION_TOKEN = 3 + + # Deprecated: Use `express_settings` instead. + EXPRESS = 5 + end + + # Web Application Firewalls that reCAPTCHA supports. + # Ensure that applications can handle values not explicitly listed. + module WafService + # Undefined WAF + WAF_SERVICE_UNSPECIFIED = 0 + + # Cloud Armor + CA = 1 + + # Fastly + FASTLY = 3 + + # Cloudflare + CLOUDFLARE = 4 + + # Akamai + AKAMAI = 5 + end + end + + # The environment creating the assessment. This describes your environment + # (the system invoking CreateAssessment), NOT the environment of your user. + # @!attribute [rw] client + # @return [::String] + # Optional. Identifies the client module initiating the CreateAssessment + # request. This can be the link to the client module's project. Examples + # include: + # + # - + # "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" + # - "wordpress.org/plugins/recaptcha-something" + # @!attribute [rw] version + # @return [::String] + # Optional. The version of the client module. For example, "1.0.0". + class AssessmentEnvironment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the IP or IP range override. + # @!attribute [rw] ip + # @return [::String] + # Required. The IP address to override (can be IPv4, IPv6 or CIDR). + # The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. + # The IP override must be a public IP address. + # Example of IPv4: 168.192.5.6 + # Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B + # Example of IPv4 with CIDR: 168.192.5.0/24 + # Example of IPv6 with CIDR: 2001:0DB8:1234::/48 + # @!attribute [rw] override_type + # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData::OverrideType] + # Required. Describes the type of IP override. + class IpOverrideData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the type of IP override. + # Ensure that applications can handle values not explicitly listed. + module OverrideType + # Default override type that indicates this enum hasn't been specified. + OVERRIDE_TYPE_UNSPECIFIED = 0 + + # Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for + # all valid assessments. + ALLOW = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile new file mode 100644 index 000000000000..ecbdc5a6605c --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1", path: "../" +else + gem "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb new file mode 100644 index 000000000000..2cd93faef1ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the add_ip_override call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override. +# +def add_ip_override + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new + + # Call the add_ip_override method. + result = client.add_ip_override request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb new file mode 100644 index 000000000000..a4e7cfd8ae7e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment. +# +def annotate_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new + + # Call the annotate_assessment method. + result = client.annotate_assessment request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb new file mode 100644 index 000000000000..0faeb6dd26ee --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the create_assessment call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment. +# +def create_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new + + # Call the create_assessment method. + result = client.create_assessment request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb new file mode 100644 index 000000000000..6161259992c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the create_firewall_policy call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy. +# +def create_firewall_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new + + # Call the create_firewall_policy method. + result = client.create_firewall_policy request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb new file mode 100644 index 000000000000..17732dc4f67e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the create_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key. +# +def create_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new + + # Call the create_key method. + result = client.create_key request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb new file mode 100644 index 000000000000..4043f5b69b08 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the delete_firewall_policy call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy. +# +def delete_firewall_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new + + # Call the delete_firewall_policy method. + result = client.delete_firewall_policy request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb new file mode 100644 index 000000000000..5303f077ca44 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the delete_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key. +# +def delete_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new + + # Call the delete_key method. + result = client.delete_key request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb new file mode 100644 index 000000000000..20c22a7354d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the get_firewall_policy call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy. +# +def get_firewall_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new + + # Call the get_firewall_policy method. + result = client.get_firewall_policy request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb new file mode 100644 index 000000000000..4c3b7da228bb --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the get_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key. +# +def get_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new + + # Call the get_key method. + result = client.get_key request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb new file mode 100644 index 000000000000..e70958bdf776 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the get_metrics call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics. +# +def get_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new + + # Call the get_metrics method. + result = client.get_metrics request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb new file mode 100644 index 000000000000..cac6a23ab90f --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the list_firewall_policies call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies. +# +def list_firewall_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.new + + # Call the list_firewall_policies method. + result = client.list_firewall_policies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb new file mode 100644 index 000000000000..b028a8f6caa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the list_ip_overrides call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides. +# +def list_ip_overrides + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.new + + # Call the list_ip_overrides method. + result = client.list_ip_overrides request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb new file mode 100644 index 000000000000..7e6a4cabb356 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the list_keys call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys. +# +def list_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new + + # Call the list_keys method. + result = client.list_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::RecaptchaEnterprise::V1::Key. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb new file mode 100644 index 000000000000..ece30d40559d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the list_related_account_group_memberships call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships. +# +def list_related_account_group_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new + + # Call the list_related_account_group_memberships method. + result = client.list_related_account_group_memberships request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb new file mode 100644 index 000000000000..d19c5f95a161 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the list_related_account_groups call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups. +# +def list_related_account_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new + + # Call the list_related_account_groups method. + result = client.list_related_account_groups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb new file mode 100644 index 000000000000..3790cc8bf22d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the migrate_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key. +# +def migrate_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new + + # Call the migrate_key method. + result = client.migrate_key request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb new file mode 100644 index 000000000000..775dae1c3506 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the remove_ip_override call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override. +# +def remove_ip_override + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new + + # Call the remove_ip_override method. + result = client.remove_ip_override request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb new file mode 100644 index 000000000000..0785a8c5770d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the reorder_firewall_policies call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies. +# +def reorder_firewall_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new + + # Call the reorder_firewall_policies method. + result = client.reorder_firewall_policies request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb new file mode 100644 index 000000000000..a5aff30875f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the retrieve_legacy_secret_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key. +# +def retrieve_legacy_secret_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new + + # Call the retrieve_legacy_secret_key method. + result = client.retrieve_legacy_secret_key request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb new file mode 100644 index 000000000000..8ca6af8cafde --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the search_related_account_group_memberships call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships. +# +def search_related_account_group_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new + + # Call the search_related_account_group_memberships method. + result = client.search_related_account_group_memberships request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + p item + end +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb new file mode 100644 index 000000000000..1c0edac34c62 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the update_firewall_policy call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy. +# +def update_firewall_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new + + # Call the update_firewall_policy method. + result = client.update_firewall_policy request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb new file mode 100644 index 000000000000..f6b0ed5da093 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] +require "google/cloud/recaptcha_enterprise/v1" + +## +# Snippet for the update_key call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key. +# +def update_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new + + # Call the update_key method. + result = client.update_key request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end +# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json new file mode 100644 index 000000000000..3f47d419cda8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-recaptcha_enterprise-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync", + "title": "Snippet for the create_assessment call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment.", + "file": "recaptcha_enterprise_service/create_assessment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_assessment", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Assessment", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "CreateAssessment", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync", + "title": "Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment.", + "file": "recaptcha_enterprise_service/annotate_assessment.rb", + "language": "RUBY", + "client_method": { + "short_name": "annotate_assessment", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "AnnotateAssessment", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync", + "title": "Snippet for the create_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key.", + "file": "recaptcha_enterprise_service/create_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "CreateKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync", + "title": "Snippet for the list_keys call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys.", + "file": "recaptcha_enterprise_service/list_keys.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_keys", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ListKeys", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync", + "title": "Snippet for the retrieve_legacy_secret_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key.", + "file": "recaptcha_enterprise_service/retrieve_legacy_secret_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "retrieve_legacy_secret_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "RetrieveLegacySecretKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync", + "title": "Snippet for the get_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key.", + "file": "recaptcha_enterprise_service/get_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "GetKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync", + "title": "Snippet for the update_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key.", + "file": "recaptcha_enterprise_service/update_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "UpdateKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync", + "title": "Snippet for the delete_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key.", + "file": "recaptcha_enterprise_service/delete_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "DeleteKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync", + "title": "Snippet for the migrate_key call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key.", + "file": "recaptcha_enterprise_service/migrate_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "migrate_key", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "MigrateKey", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync", + "title": "Snippet for the add_ip_override call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override.", + "file": "recaptcha_enterprise_service/add_ip_override.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_ip_override", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "AddIpOverride", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverride", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync", + "title": "Snippet for the remove_ip_override call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override.", + "file": "recaptcha_enterprise_service/remove_ip_override.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_ip_override", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "RemoveIpOverride", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RemoveIpOverride", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync", + "title": "Snippet for the list_ip_overrides call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides.", + "file": "recaptcha_enterprise_service/list_ip_overrides.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_ip_overrides", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ListIpOverrides", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListIpOverrides", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync", + "title": "Snippet for the get_metrics call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics.", + "file": "recaptcha_enterprise_service/get_metrics.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_metrics", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Metrics", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "GetMetrics", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync", + "title": "Snippet for the create_firewall_policy call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy.", + "file": "recaptcha_enterprise_service/create_firewall_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_firewall_policy", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "CreateFirewallPolicy", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateFirewallPolicy", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync", + "title": "Snippet for the list_firewall_policies call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies.", + "file": "recaptcha_enterprise_service/list_firewall_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_firewall_policies", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ListFirewallPolicies", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListFirewallPolicies", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync", + "title": "Snippet for the get_firewall_policy call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy.", + "file": "recaptcha_enterprise_service/get_firewall_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_firewall_policy", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "GetFirewallPolicy", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetFirewallPolicy", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync", + "title": "Snippet for the update_firewall_policy call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy.", + "file": "recaptcha_enterprise_service/update_firewall_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_firewall_policy", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "UpdateFirewallPolicy", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateFirewallPolicy", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync", + "title": "Snippet for the delete_firewall_policy call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy.", + "file": "recaptcha_enterprise_service/delete_firewall_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_firewall_policy", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "DeleteFirewallPolicy", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteFirewallPolicy", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync", + "title": "Snippet for the reorder_firewall_policies call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies.", + "file": "recaptcha_enterprise_service/reorder_firewall_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "reorder_firewall_policies", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ReorderFirewallPolicies", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ReorderFirewallPolicies", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync", + "title": "Snippet for the list_related_account_groups call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups.", + "file": "recaptcha_enterprise_service/list_related_account_groups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_related_account_groups", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ListRelatedAccountGroups", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync", + "title": "Snippet for the list_related_account_group_memberships call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships.", + "file": "recaptcha_enterprise_service/list_related_account_group_memberships.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_related_account_group_memberships", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "ListRelatedAccountGroupMemberships", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync", + "title": "Snippet for the search_related_account_group_memberships call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships.", + "file": "recaptcha_enterprise_service/search_related_account_group_memberships.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_related_account_group_memberships", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "SearchRelatedAccountGroupMemberships", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb new file mode 100644 index 000000000000..5ace4590a74e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_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/recaptcha_enterprise/v1/recaptcha_enterprise_service" + +class ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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_assessment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assessment_path project: "value0", assessment: "value1" + assert_equal "projects/value0/assessments/value1", path + end + end + + def test_firewall_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.firewall_policy_path project: "value0", firewallpolicy: "value1" + assert_equal "projects/value0/firewallpolicies/value1", path + end + end + + def test_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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.key_path project: "value0", key: "value1" + assert_equal "projects/value0/keys/value1", path + end + end + + def test_metrics_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.metrics_path project: "value0", key: "value1" + assert_equal "projects/value0/keys/value1/metrics", 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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_related_account_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.related_account_group_path project: "value0", relatedaccountgroup: "value1" + assert_equal "projects/value0/relatedaccountgroups/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb new file mode 100644 index 000000000000..0dc007446ff3 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb" +require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service" + +class ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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_assessment + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Assessment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + assessment = {} + + create_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_assessment, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Assessment), request["assessment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_assessment({ parent: parent, assessment: assessment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_assessment parent: parent, assessment: assessment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_assessment({ parent: parent, assessment: assessment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_assessment_client_stub.call_rpc_count + end + end + + def test_annotate_assessment + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + annotation = :ANNOTATION_UNSPECIFIED + reasons = [:REASON_UNSPECIFIED] + account_id = "hello world" + hashed_account_id = "hello world" + transaction_event = {} + phone_authentication_event = {} + + annotate_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :annotate_assessment, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, request + assert_equal "hello world", request["name"] + assert_equal :ANNOTATION_UNSPECIFIED, request["annotation"] + assert_equal [:REASON_UNSPECIFIED], request["reasons"] + assert_equal "hello world", request["account_id"] + assert_equal "hello world", request["hashed_account_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent), request["transaction_event"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent), request["phone_authentication_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, annotate_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.annotate_assessment name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, annotate_assessment_client_stub.call_rpc_count + end + end + + def test_create_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + key = {} + + create_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Key), request["key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_key({ parent: parent, key: key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_key parent: parent, key: key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_key ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new(parent: parent, key: key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_key({ parent: parent, key: key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_key(::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new(parent: parent, key: key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_key_client_stub.call_rpc_count + end + end + + def test_list_keys + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_keys, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, 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_keys_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_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_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_keys ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.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_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_keys(::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.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_keys_client_stub.call_rpc_count + end + end + + def test_retrieve_legacy_secret_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + key = "hello world" + + retrieve_legacy_secret_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :retrieve_legacy_secret_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, request + assert_equal "hello world", request["key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, retrieve_legacy_secret_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.retrieve_legacy_secret_key({ key: key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.retrieve_legacy_secret_key key: key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.retrieve_legacy_secret_key ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new(key: key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.retrieve_legacy_secret_key({ key: key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.retrieve_legacy_secret_key(::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new(key: key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, retrieve_legacy_secret_key_client_stub.call_rpc_count + end + end + + def test_get_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_key ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_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_key(::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_key_client_stub.call_rpc_count + end + end + + def test_update_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + key = {} + update_mask = {} + + update_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Key), request["key"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_key({ key: key, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_key key: key, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_key ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new(key: key, 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_key({ key: key, 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_key(::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new(key: key, 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_key_client_stub.call_rpc_count + end + end + + def test_delete_key + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_key ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_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.delete_key(::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new(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_key_client_stub.call_rpc_count + end + end + + def test_migrate_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + skip_billing_check = true + + migrate_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :migrate_key, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["skip_billing_check"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, migrate_key_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.migrate_key({ name: name, skip_billing_check: skip_billing_check }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.migrate_key name: name, skip_billing_check: skip_billing_check do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.migrate_key ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new(name: name, skip_billing_check: skip_billing_check) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.migrate_key({ name: name, skip_billing_check: skip_billing_check }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.migrate_key(::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new(name: name, skip_billing_check: skip_billing_check), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, migrate_key_client_stub.call_rpc_count + end + end + + def test_add_ip_override + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ip_override_data = {} + + add_ip_override_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_ip_override, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData), request["ip_override_data"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_ip_override_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_ip_override({ name: name, ip_override_data: ip_override_data }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_ip_override name: name, ip_override_data: ip_override_data do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_ip_override ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new(name: name, ip_override_data: ip_override_data) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_ip_override({ name: name, ip_override_data: ip_override_data }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_ip_override(::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new(name: name, ip_override_data: ip_override_data), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_ip_override_client_stub.call_rpc_count + end + end + + def test_remove_ip_override + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ip_override_data = {} + + remove_ip_override_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_ip_override, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData), request["ip_override_data"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_ip_override_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_ip_override({ name: name, ip_override_data: ip_override_data }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_ip_override name: name, ip_override_data: ip_override_data do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_ip_override ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new(name: name, ip_override_data: ip_override_data) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_ip_override({ name: name, ip_override_data: ip_override_data }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_ip_override(::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new(name: name, ip_override_data: ip_override_data), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_ip_override_client_stub.call_rpc_count + end + end + + def test_list_ip_overrides + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_ip_overrides_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_ip_overrides, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, 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_ip_overrides_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_ip_overrides({ parent: parent, page_size: page_size, page_token: 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_ip_overrides parent: parent, page_size: page_size, page_token: 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_ip_overrides ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.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_ip_overrides({ 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_ip_overrides(::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.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_ip_overrides_client_stub.call_rpc_count + end + end + + def test_get_metrics + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Metrics.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_metrics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_metrics, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_metrics_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_metrics({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_metrics name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_metrics ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_metrics({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_metrics(::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_metrics_client_stub.call_rpc_count + end + end + + def test_create_firewall_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + firewall_policy = {} + + create_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_firewall_policy, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy), request["firewall_policy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_firewall_policy_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_firewall_policy({ parent: parent, firewall_policy: firewall_policy }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_firewall_policy parent: parent, firewall_policy: firewall_policy do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new(parent: parent, firewall_policy: firewall_policy) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_firewall_policy({ parent: parent, firewall_policy: firewall_policy }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new(parent: parent, firewall_policy: firewall_policy), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_firewall_policy_client_stub.call_rpc_count + end + end + + def test_list_firewall_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_firewall_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_firewall_policies, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, 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_firewall_policies_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_firewall_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_firewall_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_firewall_policies ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.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_firewall_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_firewall_policies(::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.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_firewall_policies_client_stub.call_rpc_count + end + end + + def test_get_firewall_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_firewall_policy, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_firewall_policy_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_firewall_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_firewall_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_firewall_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_firewall_policy_client_stub.call_rpc_count + end + end + + def test_update_firewall_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + firewall_policy = {} + update_mask = {} + + update_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_firewall_policy, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy), request["firewall_policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_firewall_policy_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_firewall_policy({ firewall_policy: firewall_policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_firewall_policy firewall_policy: firewall_policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new(firewall_policy: firewall_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.update_firewall_policy({ firewall_policy: firewall_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.update_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new(firewall_policy: firewall_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, update_firewall_policy_client_stub.call_rpc_count + end + end + + def test_delete_firewall_policy + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_firewall_policy, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_firewall_policy_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_firewall_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_firewall_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_firewall_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new(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_firewall_policy_client_stub.call_rpc_count + end + end + + def test_reorder_firewall_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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"] + + reorder_firewall_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reorder_firewall_policies, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reorder_firewall_policies_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reorder_firewall_policies({ parent: parent, names: names }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reorder_firewall_policies parent: parent, names: names do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reorder_firewall_policies ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new(parent: parent, names: names) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reorder_firewall_policies({ parent: parent, names: names }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reorder_firewall_policies(::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new(parent: parent, names: names), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reorder_firewall_policies_client_stub.call_rpc_count + end + end + + def test_list_related_account_groups + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_related_account_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_related_account_groups, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, 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_related_account_groups_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_related_account_groups({ parent: parent, page_size: page_size, page_token: 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_related_account_groups parent: parent, page_size: page_size, page_token: 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_related_account_groups ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.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_related_account_groups({ 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_related_account_groups(::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.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_related_account_groups_client_stub.call_rpc_count + end + end + + def test_list_related_account_group_memberships + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_related_account_group_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_related_account_group_memberships, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, 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_related_account_group_memberships_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_related_account_group_memberships({ parent: parent, page_size: page_size, page_token: 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_related_account_group_memberships parent: parent, page_size: page_size, page_token: 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_related_account_group_memberships ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.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_related_account_group_memberships({ 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_related_account_group_memberships(::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.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_related_account_group_memberships_client_stub.call_rpc_count + end + end + + def test_search_related_account_group_memberships + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + account_id = "hello world" + hashed_account_id = "hello world" + page_size = 42 + page_token = "hello world" + + search_related_account_group_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_related_account_group_memberships, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, request + assert_equal "hello world", request["project"] + assert_equal "hello world", request["account_id"] + assert_equal "hello world", request["hashed_account_id"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_related_account_group_memberships_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_related_account_group_memberships({ project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_related_account_group_memberships project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_related_account_group_memberships ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new(project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_related_account_group_memberships({ project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_related_account_group_memberships(::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new(project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_related_account_group_memberships_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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..f893403d339d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "recaptchaenterprise.googleapis.com", + "api_shortname": "recaptchaenterprise", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1beta1/latest", + "distribution_name": "google-cloud-recaptcha_enterprise-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "recaptchaenterprise", + "name_pretty": "reCAPTCHA Enterprise V1beta1 API", + "product_documentation": "https://cloud.google.com/recaptcha-enterprise", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", + "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", + "ruby-cloud-service-override": "RecaptchaEnterpriseServiceV1Beta1=RecaptchaEnterpriseService", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..9a1ea4dffbc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts new file mode 100644 index 000000000000..23d0ee7fd22d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="reCAPTCHA Enterprise 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-recaptcha_enterprise-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..70a1f346f468 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" + +client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recaptcha_enterprise/v1beta1" + +::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md new file mode 100644 index 000000000000..05dcd1e387b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the reCAPTCHA Enterprise V1beta1 API + +Help protect your website from fraudulent activity, spam, and abuse without creating friction. + +reCAPTCHA Enterprise is a service that protects your site from spam and abuse. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the reCAPTCHA Enterprise V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-recaptcha_enterprise](https://rubygems.org/gems/google-cloud-recaptcha_enterprise). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-recaptcha_enterprise-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/recaptchaenterprise.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/recaptcha_enterprise/v1beta1" + +client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new +request = ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new # (request fields as keyword arguments...) +response = client.create_assessment request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) +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/recaptcha_enterprise/v1beta1" +require "logger" + +client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. +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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Rakefile new file mode 100644 index 000000000000..20d431ff9810 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" + ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recaptcha_enterprise-v1beta1" + header "google-cloud-recaptcha_enterprise-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recaptcha_enterprise-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..115e99300266 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json @@ -0,0 +1,28 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", + "libraryPackage": "::Google::Cloud::RecaptchaEnterprise::V1beta1", + "services": { + "RecaptchaEnterpriseServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client", + "rpcs": { + "CreateAssessment": { + "methods": [ + "create_assessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotate_assessment" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec new file mode 100644 index 000000000000..5b7e33e7c000 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recaptcha_enterprise/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recaptcha_enterprise-v1beta1" + gem.version = Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details." + gem.summary = "Help protect your website from fraudulent activity, spam, and abuse without creating friction." + 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-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb new file mode 100644 index 000000000000..6c4253f03b51 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb new file mode 100644 index 000000000000..80b907a89991 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" +require "google/cloud/recaptcha_enterprise/v1beta1/version" + +module Google + module Cloud + module RecaptchaEnterprise + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/recaptcha_enterprise/v1beta1" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/recaptcha_enterprise/v1beta1" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/recaptcha_enterprise/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb new file mode 100644 index 000000000000..a3ad99c59f3a --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/version" + +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + ## + # Service to determine the likelihood an event is legitimate. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + module RecaptchaEnterpriseService + end + end + end + end +end + +helper_path = ::File.join __dir__, "recaptcha_enterprise_service", "helpers.rb" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb new file mode 100644 index 000000000000..ef8c94f53ed9 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb @@ -0,0 +1,590 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseService + ## + # Client for the RecaptchaEnterpriseService service. + # + # Service to determine the likelihood an event is legitimate. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recaptcha_enterprise_service_stub + + ## + # Configure the RecaptchaEnterpriseService Client class. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecaptchaEnterpriseService clients + # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RecaptchaEnterprise", "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.create_assessment.timeout = 600.0 + + default_config.rpcs.annotate_assessment.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecaptchaEnterpriseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recaptcha_enterprise_service_stub.universe_domain + end + + ## + # Create a new RecaptchaEnterpriseService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecaptchaEnterpriseService 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/recaptchaenterprise/v1beta1/recaptchaenterprise_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 + + @recaptcha_enterprise_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseServiceV1Beta1::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 + ) + + @recaptcha_enterprise_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @recaptcha_enterprise_service_stub.logger + end + + # Service calls + + ## + # Creates an Assessment of the likelihood an event is legitimate. + # + # @overload create_assessment(request, options = nil) + # Pass arguments to `create_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_assessment(parent: nil, assessment: nil) + # Pass arguments to `create_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 project in which the assessment is created, + # in the format `projects/{project_number}`. + # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment, ::Hash] + # Required. The assessment details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new + # + # # Call the create_assessment method. + # result = client.create_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. + # p result + # + def create_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest + + # Converts hash and nil to 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_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_assessment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Annotates a previously created Assessment to provide additional information + # on whether the event turned out to be authentic or fradulent. + # + # @overload annotate_assessment(request, options = nil) + # Pass arguments to `annotate_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) + # Pass arguments to `annotate_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Assessment, in the format + # `projects/{project_number}/assessments/{assessment_id}`. + # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] + # Optional. The annotation that is assigned to the Event. This field can be + # left empty to provide reasons that apply to an event without concluding + # whether the event is legitimate or fraudulent. + # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] + # Optional. Reasons for the annotation that are assigned to the event. + # @param hashed_account_id [::String] + # Optional. Unique stable hashed user identifier to apply to the assessment. + # This is an alternative to setting the `hashed_account_id` in + # `CreateAssessment`, for example, when the account identifier is not yet + # known in the initial request. It is recommended that the identifier is + # hashed using hmac-sha256 with stable secret. + # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash] + # Optional. If the assessment is part of a payment transaction, provide + # details on payment lifecycle events that occur in the transaction. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new + # + # # Call the annotate_assessment method. + # result = client.annotate_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. + # p result + # + def annotate_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.annotate_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.annotate_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, 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 RecaptchaEnterpriseService API. + # + # This class represents the configuration for RecaptchaEnterpriseService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_assessment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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 = "recaptchaenterprise.googleapis.com" + + config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_assessment + ## + # RPC-specific configuration for `annotate_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :annotate_assessment + + # @private + def initialize parent_rpcs = nil + create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment + @create_assessment = ::Gapic::Config::Method.new create_assessment_config + annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment + @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb new file mode 100644 index 000000000000..484ac47237b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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 RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseService + # Credentials for the RecaptchaEnterpriseService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECAPTCHA_ENTERPRISE_CREDENTIALS", + "RECAPTCHA_ENTERPRISE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON", + "RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb new file mode 100644 index 000000000000..b55591922ef0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/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 RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseService + # Path helper methods for the RecaptchaEnterpriseService API. + module Paths + ## + # Create a fully-qualified Assessment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/assessments/{assessment}` + # + # @param project [String] + # @param assessment [String] + # + # @return [::String] + def assessment_path project:, assessment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/assessments/#{assessment}" + 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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb new file mode 100644 index 000000000000..2f14ab8e40be --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/version" + +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client" + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + ## + # Service to determine the likelihood an event is legitimate. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + module RecaptchaEnterpriseService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb new file mode 100644 index 000000000000..b63a63711ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb @@ -0,0 +1,533 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub" + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseService + module Rest + ## + # REST client for the RecaptchaEnterpriseService service. + # + # Service to determine the likelihood an event is legitimate. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recaptcha_enterprise_service_stub + + ## + # Configure the RecaptchaEnterpriseService Client class. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecaptchaEnterpriseService clients + # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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", "RecaptchaEnterprise", "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.create_assessment.timeout = 600.0 + + default_config.rpcs.annotate_assessment.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecaptchaEnterpriseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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 + @recaptcha_enterprise_service_stub.universe_domain + end + + ## + # Create a new RecaptchaEnterpriseService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecaptchaEnterpriseService 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 + + @recaptcha_enterprise_service_stub = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @recaptcha_enterprise_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @recaptcha_enterprise_service_stub.logger + end + + # Service calls + + ## + # Creates an Assessment of the likelihood an event is legitimate. + # + # @overload create_assessment(request, options = nil) + # Pass arguments to `create_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_assessment(parent: nil, assessment: nil) + # Pass arguments to `create_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 project in which the assessment is created, + # in the format `projects/{project_number}`. + # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment, ::Hash] + # Required. The assessment details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new + # + # # Call the create_assessment method. + # result = client.create_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. + # p result + # + def create_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest + + # Converts hash and nil to an 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_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_assessment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.create_assessment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Annotates a previously created Assessment to provide additional information + # on whether the event turned out to be authentic or fradulent. + # + # @overload annotate_assessment(request, options = nil) + # Pass arguments to `annotate_assessment` via a request object, either of type + # {::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) + # Pass arguments to `annotate_assessment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Assessment, in the format + # `projects/{project_number}/assessments/{assessment_id}`. + # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] + # Optional. The annotation that is assigned to the Event. This field can be + # left empty to provide reasons that apply to an event without concluding + # whether the event is legitimate or fraudulent. + # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] + # Optional. Reasons for the annotation that are assigned to the event. + # @param hashed_account_id [::String] + # Optional. Unique stable hashed user identifier to apply to the assessment. + # This is an alternative to setting the `hashed_account_id` in + # `CreateAssessment`, for example, when the account identifier is not yet + # known in the initial request. It is recommended that the identifier is + # hashed using hmac-sha256 with stable secret. + # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash] + # Optional. If the assessment is part of a payment transaction, provide + # details on payment lifecycle events that occur in the transaction. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recaptcha_enterprise/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new + # + # # Call the annotate_assessment method. + # result = client.annotate_assessment request + # + # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. + # p result + # + def annotate_assessment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.annotate_assessment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.annotate_assessment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recaptcha_enterprise_service_stub.annotate_assessment request, 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 RecaptchaEnterpriseService REST API. + # + # This class represents the configuration for RecaptchaEnterpriseService 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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_assessment.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "recaptchaenterprise.googleapis.com" + + config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_assessment + ## + # RPC-specific configuration for `annotate_assessment` + # @return [::Gapic::Config::Method] + # + attr_reader :annotate_assessment + + # @private + def initialize parent_rpcs = nil + create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment + @create_assessment = ::Gapic::Config::Method.new create_assessment_config + annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment + @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb new file mode 100644 index 000000000000..2a95d5352a94 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseService + module Rest + ## + # REST service stub for the RecaptchaEnterpriseService 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_assessment REST call + # + # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # A result object deserialized from the server's reply + def create_assessment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_assessment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_assessment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the annotate_assessment REST call + # + # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] + # A result object deserialized from the server's reply + def annotate_assessment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_annotate_assessment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "annotate_assessment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.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_assessment REST call + # + # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest] + # 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_assessment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/assessments", + body: "assessment", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the annotate_assessment REST call + # + # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_annotate_assessment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:annotate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/assessments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb new file mode 100644 index 000000000000..db8e11adc626 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" +require "google/cloud/recaptcha_enterprise/v1beta1/version" + +module Google + module Cloud + module RecaptchaEnterprise + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/recaptcha_enterprise/v1beta1/rest" + # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb new file mode 100644 index 000000000000..ca24b6a6324d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb new file mode 100644 index 000000000000..dd66122e26fc --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.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/protobuf/timestamp_pb' + + +descriptor_data = "\nBgoogle/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto\x12(google.cloud.recaptchaenterprise.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xad\x01\n\x17\x43reateAssessmentRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12M\n\nassessment\x18\x02 \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1beta1.AssessmentB\x03\xe0\x41\x02\"\x97\x05\n\x10TransactionEvent\x12h\n\nevent_type\x18\x01 \x01(\x0e\x32O.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventTypeB\x03\xe0\x41\x01\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xba\x03\n\x14TransactionEventType\x12&\n\"TRANSACTION_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10MERCHANT_APPROVE\x10\x01\x12\x11\n\rMERCHANT_DENY\x10\x02\x12\x11\n\rMANUAL_REVIEW\x10\x03\x12\x11\n\rAUTHORIZATION\x10\x04\x12\x19\n\x15\x41UTHORIZATION_DECLINE\x10\x05\x12\x13\n\x0fPAYMENT_CAPTURE\x10\x06\x12\x1b\n\x17PAYMENT_CAPTURE_DECLINE\x10\x07\x12\n\n\x06\x43\x41NCEL\x10\x08\x12\x16\n\x12\x43HARGEBACK_INQUIRY\x10\t\x12\x14\n\x10\x43HARGEBACK_ALERT\x10\n\x12\x16\n\x12\x46RAUD_NOTIFICATION\x10\x0b\x12\x0e\n\nCHARGEBACK\x10\x0c\x12\x1c\n\x18\x43HARGEBACK_REPRESENTMENT\x10\r\x12\x16\n\x12\x43HARGEBACK_REVERSE\x10\x0e\x12\x12\n\x0eREFUND_REQUEST\x10\x0f\x12\x12\n\x0eREFUND_DECLINE\x10\x10\x12\n\n\x06REFUND\x10\x11\x12\x12\n\x0eREFUND_REVERSE\x10\x12\"\xf9\x06\n\x19\x41nnotateAssessmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recaptchaenterprise.googleapis.com/Assessment\x12g\n\nannotation\x18\x02 \x01(\x0e\x32N.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.AnnotationB\x03\xe0\x41\x01\x12`\n\x07reasons\x18\x03 \x03(\x0e\x32J.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.ReasonB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x01\x12Z\n\x11transaction_event\x18\x05 \x01(\x0b\x32:.google.cloud.recaptchaenterprise.v1beta1.TransactionEventB\x03\xe0\x41\x01\"~\n\nAnnotation\x12\x1a\n\x16\x41NNOTATION_UNSPECIFIED\x10\x00\x12\x0e\n\nLEGITIMATE\x10\x01\x12\x0e\n\nFRAUDULENT\x10\x02\x12\x18\n\x10PASSWORD_CORRECT\x10\x03\x1a\x02\x08\x01\x12\x1a\n\x12PASSWORD_INCORRECT\x10\x04\x1a\x02\x08\x01\"\xcf\x02\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nCHARGEBACK\x10\x01\x12\x14\n\x10\x43HARGEBACK_FRAUD\x10\x08\x12\x16\n\x12\x43HARGEBACK_DISPUTE\x10\t\x12\n\n\x06REFUND\x10\n\x12\x10\n\x0cREFUND_FRAUD\x10\x0b\x12\x18\n\x14TRANSACTION_ACCEPTED\x10\x0c\x12\x18\n\x14TRANSACTION_DECLINED\x10\r\x12\x16\n\x12PAYMENT_HEURISTICS\x10\x02\x12\x18\n\x14INITIATED_TWO_FACTOR\x10\x07\x12\x15\n\x11PASSED_TWO_FACTOR\x10\x03\x12\x15\n\x11\x46\x41ILED_TWO_FACTOR\x10\x04\x12\x14\n\x10\x43ORRECT_PASSWORD\x10\x05\x12\x16\n\x12INCORRECT_PASSWORD\x10\x06\x12\x0f\n\x0bSOCIAL_SPAM\x10\x0e\"\x1c\n\x1a\x41nnotateAssessmentResponse\"\x86\x01\n\x18PasswordLeakVerification\x12$\n\x17hashed_user_credentials\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x63redentials_leaked\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12#\n\x16\x63\x61nonicalized_username\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb7\x07\n\nAssessment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12>\n\x05\x65vent\x18\x02 \x01(\x0b\x32/.google.cloud.recaptchaenterprise.v1beta1.Event\x12\x12\n\x05score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03\x12X\n\x10token_properties\x18\x04 \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1beta1.TokenPropertiesB\x03\xe0\x41\x03\x12_\n\x07reasons\x18\x05 \x03(\x0e\x32I.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReasonB\x03\xe0\x41\x03\x12\x66\n\x1apassword_leak_verification\x18\x07 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification\x12h\n\x1b\x61\x63\x63ount_defender_assessment\x18\x08 \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment\x12h\n\x1b\x66raud_prevention_assessment\x18\x0b \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment\"\xe9\x01\n\x14\x43lassificationReason\x12%\n!CLASSIFICATION_REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nAUTOMATION\x10\x01\x12\x1a\n\x16UNEXPECTED_ENVIRONMENT\x10\x02\x12\x14\n\x10TOO_MUCH_TRAFFIC\x10\x03\x12\x1d\n\x19UNEXPECTED_USAGE_PATTERNS\x10\x04\x12\x18\n\x14LOW_CONFIDENCE_SCORE\x10\x05\x12\x15\n\x11SUSPECTED_CARDING\x10\x06\x12\x18\n\x14SUSPECTED_CHARGEBACK\x10\x07:_\xea\x41\\\n-recaptchaenterprise.googleapis.com/Assessment\x12+projects/{project}/assessments/{assessment}\"\xb1\x03\n\x05\x45vent\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08site_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fuser_ip_address\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x65xpected_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12X\n\x10transaction_data\x18\r \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1beta1.TransactionDataB\x03\xe0\x41\x01\x12^\n\x10\x66raud_prevention\x18\x11 \x01(\x0e\x32?.google.cloud.recaptchaenterprise.v1beta1.Event.FraudPreventionB\x03\xe0\x41\x01\"N\n\x0f\x46raudPrevention\x12 \n\x1c\x46RAUD_PREVENTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\x9d\t\n\x0fTransactionData\x12\x1b\n\x0etransaction_id\x18\x0b \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0epayment_method\x18\x01 \x01(\t\x12\x10\n\x08\x63\x61rd_bin\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61rd_last_four\x18\x03 \x01(\t\x12\x15\n\rcurrency_code\x18\x04 \x01(\t\x12\r\n\x05value\x18\x05 \x01(\x01\x12\x16\n\x0eshipping_value\x18\x0c \x01(\x01\x12[\n\x10shipping_address\x18\x06 \x01(\x0b\x32\x41.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address\x12Z\n\x0f\x62illing_address\x18\x07 \x01(\x0b\x32\x41.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address\x12L\n\x04user\x18\x08 \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User\x12Q\n\tmerchants\x18\r \x03(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User\x12M\n\x05items\x18\x0e \x03(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item\x12[\n\x0cgateway_info\x18\n \x01(\x0b\x32\x45.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo\x1a\x86\x01\n\x07\x41\x64\x64ress\x12\x11\n\trecipient\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x03(\t\x12\x10\n\x08locality\x18\x03 \x01(\t\x12\x1b\n\x13\x61\x64ministrative_area\x18\x04 \x01(\t\x12\x13\n\x0bregion_code\x18\x05 \x01(\t\x12\x13\n\x0bpostal_code\x18\x06 \x01(\t\x1a\x84\x01\n\x04User\x12\x12\n\naccount_id\x18\x06 \x01(\t\x12\x13\n\x0b\x63reation_ms\x18\x01 \x01(\x03\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\x16\n\x0e\x65mail_verified\x18\x03 \x01(\x08\x12\x14\n\x0cphone_number\x18\x04 \x01(\t\x12\x16\n\x0ephone_verified\x18\x05 \x01(\x08\x1aR\n\x04Item\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x10\n\x08quantity\x18\x03 \x01(\x03\x12\x1b\n\x13merchant_account_id\x18\x04 \x01(\t\x1ap\n\x0bGatewayInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1d\n\x15gateway_response_code\x18\x02 \x01(\t\x12\x19\n\x11\x61vs_response_code\x18\x03 \x01(\t\x12\x19\n\x11\x63vv_response_code\x18\x04 \x01(\tB\x11\n\x0f_transaction_id\"\xff\x02\n\x0fTokenProperties\x12\r\n\x05valid\x18\x01 \x01(\x08\x12_\n\x0einvalid_reason\x18\x02 \x01(\x0e\x32G.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08hostname\x18\x04 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x05 \x01(\t\"\xa8\x01\n\rInvalidReason\x12\x1e\n\x1aINVALID_REASON_UNSPECIFIED\x10\x00\x12\x1a\n\x16UNKNOWN_INVALID_REASON\x10\x01\x12\r\n\tMALFORMED\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03\x12\x08\n\x04\x44UPE\x10\x04\x12\x15\n\rSITE_MISMATCH\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MISSING\x10\x06\x12\x11\n\rBROWSER_ERROR\x10\x07\"\xc4\x04\n\x19\x46raudPreventionAssessment\x12\x1d\n\x10transaction_risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x83\x01\n\x19stolen_instrument_verdict\x18\x02 \x01(\x0b\x32[.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdictB\x03\xe0\x41\x03\x12y\n\x14\x63\x61rd_testing_verdict\x18\x03 \x01(\x0b\x32V.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdictB\x03\xe0\x41\x03\x12\x81\x01\n\x18\x62\x65havioral_trust_verdict\x18\x04 \x01(\x0b\x32Z.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.BehavioralTrustVerdictB\x03\xe0\x41\x03\x1a,\n\x17StolenInstrumentVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a\'\n\x12\x43\x61rdTestingVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a,\n\x16\x42\x65havioralTrustVerdict\x12\x12\n\x05trust\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\"\xbb\x02\n\x19\x41\x63\x63ountDefenderAssessment\x12h\n\x06labels\x18\x01 \x03(\x0e\x32X.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel\"\xb3\x01\n\x14\x41\x63\x63ountDefenderLabel\x12&\n\"ACCOUNT_DEFENDER_LABEL_UNSPECIFIED\x10\x00\x12\x11\n\rPROFILE_MATCH\x10\x01\x12\x1d\n\x19SUSPICIOUS_LOGIN_ACTIVITY\x10\x02\x12\x1f\n\x1bSUSPICIOUS_ACCOUNT_CREATION\x10\x03\x12 \n\x1cRELATED_ACCOUNTS_NUMBER_HIGH\x10\x04\x32\xcd\x04\n!RecaptchaEnterpriseServiceV1Beta1\x12\xdd\x01\n\x10\x43reateAssessment\x12\x41.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest\x1a\x34.google.cloud.recaptchaenterprise.v1beta1.Assessment\"P\xda\x41\x11parent,assessment\x82\xd3\xe4\x93\x02\x36\"(/v1beta1/{parent=projects/*}/assessments:\nassessment\x12\xef\x01\n\x12\x41nnotateAssessment\x12\x43.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest\x1a\x44.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse\"N\xda\x41\x0fname,annotation\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{name=projects/*/assessments/*}:annotate:\x01*\x1aV\xca\x41\"recaptchaenterprise.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb2\x02\n&com.google.recaptchaenterprise.v1beta1B\x18RecaptchaEnterpriseProtoP\x01Zacloud.google.com/go/recaptchaenterprise/v2/apiv1beta1/recaptchaenterprisepb;recaptchaenterprisepb\xa2\x02\x04GCRE\xaa\x02(Google.Cloud.RecaptchaEnterprise.V1Beta1\xca\x02(Google\\Cloud\\RecaptchaEnterprise\\V1beta1\xea\x02+Google::Cloud::RecaptchaEnterprise::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 RecaptchaEnterprise + module V1beta1 + CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest").msgclass + TransactionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionEvent").msgclass + TransactionEvent::TransactionEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType").enummodule + AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest").msgclass + AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation").enummodule + AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason").enummodule + AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse").msgclass + PasswordLeakVerification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification").msgclass + Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment").msgclass + Assessment::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason").enummodule + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Event").msgclass + Event::FraudPrevention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Event.FraudPrevention").enummodule + TransactionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData").msgclass + TransactionData::Address = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address").msgclass + TransactionData::User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.User").msgclass + TransactionData::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item").msgclass + TransactionData::GatewayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo").msgclass + TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties").msgclass + TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason").enummodule + FraudPreventionAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment").msgclass + FraudPreventionAssessment::StolenInstrumentVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict").msgclass + FraudPreventionAssessment::CardTestingVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict").msgclass + FraudPreventionAssessment::BehavioralTrustVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.BehavioralTrustVerdict").msgclass + AccountDefenderAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment").msgclass + AccountDefenderAssessment::AccountDefenderLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb new file mode 100644 index 000000000000..2eafeab096fd --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.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/recaptchaenterprise/v1beta1/recaptchaenterprise_pb' + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + module RecaptchaEnterpriseServiceV1Beta1 + # Service to determine the likelihood an event is legitimate. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' + + # Creates an Assessment of the likelihood an event is legitimate. + rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment + # Annotates a previously created Assessment to provide additional information + # on whether the event turned out to be authentic or fradulent. + rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..55d54bc6f275 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# reCAPTCHA Enterprise 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-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb new file mode 100644 index 000000000000..2849e835788e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb @@ -0,0 +1,711 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecaptchaEnterprise + module V1beta1 + # The create assessment request message. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which the assessment is created, + # in the format `projects/{project_number}`. + # @!attribute [rw] assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] + # Required. The assessment details. + class CreateAssessmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes an event in the lifecycle of a payment transaction. + # @!attribute [rw] event_type + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent::TransactionEventType] + # Optional. The type of this transaction event. + # @!attribute [rw] reason + # @return [::String] + # Optional. The reason or standardized code that corresponds with this + # transaction event, if one exists. For example, a CHARGEBACK event with code + # 6005. + # @!attribute [rw] value + # @return [::Float] + # Optional. The value that corresponds with this transaction event, if one + # exists. For example, a refund event where $5.00 was refunded. Currency is + # obtained from the original transaction data. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when this transaction event occurred; otherwise assumed + # to be the time of the API call. + class TransactionEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents an event in the payment transaction lifecycle. + module TransactionEventType + # Default, unspecified event type. + TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0 + + # Indicates that the transaction is approved by the merchant. The + # accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', + # 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_APPROVE = 1 + + # Indicates that the transaction is denied and concluded due to risks + # detected by the merchant. The accompanying reasons can include terms such + # as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. + MERCHANT_DENY = 2 + + # Indicates that the transaction is being evaluated by a human, due to + # suspicion or risk. + MANUAL_REVIEW = 3 + + # Indicates that the authorization attempt with the card issuer succeeded. + AUTHORIZATION = 4 + + # Indicates that the authorization attempt with the card issuer failed. + # The accompanying reasons can include Visa's '54' indicating that the card + # is expired, or '82' indicating that the CVV is incorrect. + AUTHORIZATION_DECLINE = 5 + + # Indicates that the transaction is completed because the funds were + # settled. + PAYMENT_CAPTURE = 6 + + # Indicates that the transaction could not be completed because the funds + # were not settled. + PAYMENT_CAPTURE_DECLINE = 7 + + # Indicates that the transaction has been canceled. Specify the reason + # for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. + CANCEL = 8 + + # Indicates that the merchant has received a chargeback inquiry due to + # fraud for the transaction, requesting additional information before a + # fraud chargeback is officially issued and a formal chargeback + # notification is sent. + CHARGEBACK_INQUIRY = 9 + + # Indicates that the merchant has received a chargeback alert due to fraud + # for the transaction. The process of resolving the dispute without + # involving the payment network is started. + CHARGEBACK_ALERT = 10 + + # Indicates that a fraud notification is issued for the transaction, sent + # by the payment instrument's issuing bank because the transaction appears + # to be fraudulent. We recommend including TC40 or SAFE data in the + # `reason` field for this event type. For partial chargebacks, we recommend + # that you include an amount in the `value` field. + FRAUD_NOTIFICATION = 11 + + # Indicates that the merchant is informed by the payment network that the + # transaction has entered the chargeback process due to fraud. Reason code + # examples include Discover's '6005' and '6041'. For partial chargebacks, + # we recommend that you include an amount in the `value` field. + CHARGEBACK = 12 + + # Indicates that the transaction has entered the chargeback process due to + # fraud, and that the merchant has chosen to enter representment. Reason + # examples include Discover's '6005' and '6041'. For partial chargebacks, + # we recommend that you include an amount in the `value` field. + CHARGEBACK_REPRESENTMENT = 13 + + # Indicates that the transaction has had a fraud chargeback which was + # illegitimate and was reversed as a result. For partial chargebacks, we + # recommend that you include an amount in the `value` field. + CHARGEBACK_REVERSE = 14 + + # Indicates that the merchant has received a refund for a completed + # transaction. For partial refunds, we recommend that you include an amount + # in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of + # exempt tax) + REFUND_REQUEST = 15 + + # Indicates that the merchant has received a refund request for this + # transaction, but that they have declined it. For partial refunds, we + # recommend that you include an amount in the `value` field. Reason + # example: 'TAX_EXEMPT' (partial refund of exempt tax) + REFUND_DECLINE = 16 + + # Indicates that the completed transaction was refunded by the merchant. + # For partial refunds, we recommend that you include an amount in the + # `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt + # tax) + REFUND = 17 + + # Indicates that the completed transaction was refunded by the merchant, + # and that this refund was reversed. For partial refunds, we recommend that + # you include an amount in the `value` field. + REFUND_REVERSE = 18 + end + end + + # The request message to annotate an Assessment. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Assessment, in the format + # `projects/{project_number}/assessments/{assessment_id}`. + # @!attribute [rw] annotation + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] + # Optional. The annotation that is assigned to the Event. This field can be + # left empty to provide reasons that apply to an event without concluding + # whether the event is legitimate or fraudulent. + # @!attribute [rw] reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] + # Optional. Reasons for the annotation that are assigned to the event. + # @!attribute [rw] hashed_account_id + # @return [::String] + # Optional. Unique stable hashed user identifier to apply to the assessment. + # This is an alternative to setting the `hashed_account_id` in + # `CreateAssessment`, for example, when the account identifier is not yet + # known in the initial request. It is recommended that the identifier is + # hashed using hmac-sha256 with stable secret. + # @!attribute [rw] transaction_event + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent] + # Optional. If the assessment is part of a payment transaction, provide + # details on payment lifecycle events that occur in the transaction. + class AnnotateAssessmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the types of annotations. + module Annotation + # Default unspecified type. + ANNOTATION_UNSPECIFIED = 0 + + # Provides information that the event turned out to be legitimate. + LEGITIMATE = 1 + + # Provides information that the event turned out to be fraudulent. + FRAUDULENT = 2 + + # Provides information that the event was related to a login event in which + # the user typed the correct password. Deprecated, prefer indicating + # CORRECT_PASSWORD through the reasons field instead. + PASSWORD_CORRECT = 3 + + # Provides information that the event was related to a login event in which + # the user typed the incorrect password. Deprecated, prefer indicating + # INCORRECT_PASSWORD through the reasons field instead. + PASSWORD_INCORRECT = 4 + end + + # Enum that represents potential reasons for annotating an assessment. + module Reason + # Default unspecified reason. + REASON_UNSPECIFIED = 0 + + # Indicates that the transaction had a chargeback issued with no other + # details. When possible, specify the type by using CHARGEBACK_FRAUD or + # CHARGEBACK_DISPUTE instead. + CHARGEBACK = 1 + + # Indicates that the transaction had a chargeback issued related to an + # alleged unauthorized transaction from the cardholder's perspective (for + # example, the card number was stolen). + CHARGEBACK_FRAUD = 8 + + # Indicates that the transaction had a chargeback issued related to the + # cardholder having provided their card details but allegedly not being + # satisfied with the purchase (for example, misrepresentation, attempted + # cancellation). + CHARGEBACK_DISPUTE = 9 + + # Indicates that the completed payment transaction was refunded by the + # seller. + REFUND = 10 + + # Indicates that the completed payment transaction was determined to be + # fraudulent by the seller, and was cancelled and refunded as a result. + REFUND_FRAUD = 11 + + # Indicates that the payment transaction was accepted, and the user was + # charged. + TRANSACTION_ACCEPTED = 12 + + # Indicates that the payment transaction was declined, for example due to + # invalid card details. + TRANSACTION_DECLINED = 13 + + # Indicates the transaction associated with the assessment is suspected of + # being fraudulent based on the payment method, billing details, shipping + # address or other transaction information. + PAYMENT_HEURISTICS = 2 + + # Indicates that the user was served a 2FA challenge. An old assessment + # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + # This is equivalent to `FAILED_TWO_FACTOR`. + INITIATED_TWO_FACTOR = 7 + + # Indicates that the user passed a 2FA challenge. + PASSED_TWO_FACTOR = 3 + + # Indicates that the user failed a 2FA challenge. + FAILED_TWO_FACTOR = 4 + + # Indicates the user provided the correct password. + CORRECT_PASSWORD = 5 + + # Indicates the user provided an incorrect password. + INCORRECT_PASSWORD = 6 + + # Indicates that the user sent unwanted and abusive messages to other users + # of the platform, such as spam, scams, phishing, or social engineering. + SOCIAL_SPAM = 14 + end + end + + # Empty response for AnnotateAssessment. + class AnnotateAssessmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Password leak verification info. + # @!attribute [rw] hashed_user_credentials + # @return [::String] + # Optional. Scrypt hash of the username+password that the customer wants to + # verify against a known password leak. + # @!attribute [r] credentials_leaked + # @return [::Boolean] + # Output only. Whether or not the user's credentials are present in a known + # leak. + # @!attribute [rw] canonicalized_username + # @return [::String] + # Optional. The username part of the user credentials for which we want to + # trigger a leak check in canonicalized form. This is the same data used to + # create the hashed_user_credentials on the customer side. + class PasswordLeakVerification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reCAPTCHA Enterprise assessment resource. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name for the Assessment in the format + # `projects/{project_number}/assessments/{assessment_id}`. + # @!attribute [rw] event + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Event] + # The event being assessed. + # @!attribute [r] score + # @return [::Float] + # Output only. Legitimate event score from 0.0 to 1.0. + # (1.0 means very likely legitimate traffic while 0.0 means very likely + # non-legitimate traffic). + # @!attribute [r] token_properties + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties] + # Output only. Properties of the provided event token. + # @!attribute [r] reasons + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment::ClassificationReason>] + # Output only. Reasons contributing to the risk analysis verdict. + # @!attribute [rw] password_leak_verification + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::PasswordLeakVerification] + # Information about the user's credentials used to check for leaks. + # This feature is part of the Early Access Program (EAP). Exercise caution, + # and do not deploy integrations based on this feature in a production + # environment. + # @!attribute [rw] account_defender_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment] + # Assessment returned by account defender when a hashed_account_id is + # provided. + # @!attribute [rw] fraud_prevention_assessment + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment] + # Assessment returned by Fraud Prevention when TransactionData is provided. + class Assessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reasons contributing to the risk analysis verdict. + module ClassificationReason + # Default unspecified type. + CLASSIFICATION_REASON_UNSPECIFIED = 0 + + # Interactions matched the behavior of an automated agent. + AUTOMATION = 1 + + # The event originated from an illegitimate environment. + UNEXPECTED_ENVIRONMENT = 2 + + # Traffic volume from the event source is higher than normal. + TOO_MUCH_TRAFFIC = 3 + + # Interactions with the site were significantly different than expected + # patterns. + UNEXPECTED_USAGE_PATTERNS = 4 + + # Too little traffic has been received from this site thus far to generate + # quality risk analysis. + LOW_CONFIDENCE_SCORE = 5 + + # The request matches behavioral characteristics of a carding attack. + SUSPECTED_CARDING = 6 + + # The request matches behavioral characteristics of chargebacks for fraud. + SUSPECTED_CHARGEBACK = 7 + end + end + + # @!attribute [rw] token + # @return [::String] + # Optional. The user response token provided by the reCAPTCHA client-side + # integration on your site. + # @!attribute [rw] site_key + # @return [::String] + # Optional. The site key that was used to invoke reCAPTCHA on your site and + # generate the token. + # @!attribute [rw] user_agent + # @return [::String] + # Optional. The user agent present in the request from the user's device + # related to this event. + # @!attribute [rw] user_ip_address + # @return [::String] + # Optional. The IP address in the request from the user's device related to + # this event. + # @!attribute [rw] expected_action + # @return [::String] + # Optional. The expected action for this type of event. This should be the + # same action provided at token generation time on client-side platforms + # already integrated with reCAPTCHA. + # @!attribute [rw] hashed_account_id + # @return [::String] + # Optional. Unique stable hashed user identifier for the request. The + # identifier must be hashed using hmac-sha256 with stable secret. + # @!attribute [rw] transaction_data + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData] + # Optional. Data describing a payment transaction to be assessed. Sending + # this data enables reCAPTCHA Fraud Prevention and the + # FraudPreventionAssessment component in the response. + # @!attribute [rw] fraud_prevention + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Event::FraudPrevention] + # Optional. The Fraud Prevention setting for this Assessment. + class Event + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Setting that controls Fraud Prevention assessments. + module FraudPrevention + # Default, unspecified setting. `fraud_prevention_assessment` is returned + # if `transaction_data` is present in `Event` and Fraud Prevention is + # enabled in the Google Cloud console. + FRAUD_PREVENTION_UNSPECIFIED = 0 + + # Enable Fraud Prevention for this assessment, if Fraud Prevention is + # enabled in the Google Cloud console. + ENABLED = 1 + + # Disable Fraud Prevention for this assessment, regardless of the Google + # Cloud console settings. + DISABLED = 2 + end + end + + # Transaction data associated with a payment protected by reCAPTCHA. + # @!attribute [rw] transaction_id + # @return [::String] + # Unique identifier for the transaction. This custom identifier can be used + # to reference this transaction in the future, for example, labeling a refund + # or chargeback event. Two attempts at the same transaction should use the + # same transaction id. + # @!attribute [rw] payment_method + # @return [::String] + # The payment method for the transaction. The allowed values are: + # + # * credit-card + # * debit-card + # * gift-card + # * processor-\\{name} (If a third-party is used, for example, + # processor-paypal) + # * custom-\\{name} (If an alternative method is used, for example, + # custom-crypto) + # @!attribute [rw] card_bin + # @return [::String] + # The Bank Identification Number - generally the first 6 or 8 digits of the + # card. + # @!attribute [rw] card_last_four + # @return [::String] + # The last four digits of the card. + # @!attribute [rw] currency_code + # @return [::String] + # The currency code in ISO-4217 format. + # @!attribute [rw] value + # @return [::Float] + # The decimal value of the transaction in the specified currency. + # @!attribute [rw] shipping_value + # @return [::Float] + # The value of shipping in the specified currency. 0 for free or no shipping. + # @!attribute [rw] shipping_address + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Address] + # Destination address if this transaction involves shipping a physical item. + # @!attribute [rw] billing_address + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Address] + # Address associated with the payment method when applicable. + # @!attribute [rw] user + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::User] + # Information about the user paying/initiating the transaction. + # @!attribute [rw] merchants + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::User>] + # Information about the user or users fulfilling the transaction. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Item>] + # Items purchased in this transaction. + # @!attribute [rw] gateway_info + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::GatewayInfo] + # Information about the payment gateway's response to the transaction. + class TransactionData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Structured address format for billing and shipping addresses. + # @!attribute [rw] recipient + # @return [::String] + # The recipient name, potentially including information such as "care of". + # @!attribute [rw] address + # @return [::Array<::String>] + # The first lines of the address. The first line generally contains the + # street name and number, and further lines may include information such as + # an apartment number. + # @!attribute [rw] locality + # @return [::String] + # The town/city of the address. + # @!attribute [rw] administrative_area + # @return [::String] + # The state, province, or otherwise administrative area of the address. + # @!attribute [rw] region_code + # @return [::String] + # The CLDR country/region of the address. + # @!attribute [rw] postal_code + # @return [::String] + # The postal or ZIP code of the address. + class Address + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about a user's account involved in the transaction. + # @!attribute [rw] account_id + # @return [::String] + # Unique account identifier for this user. If using account defender, + # this should match the hashed_account_id field. Otherwise, a unique and + # persistent identifier for this account. + # @!attribute [rw] creation_ms + # @return [::Integer] + # The epoch milliseconds of the user's account creation. + # @!attribute [rw] email + # @return [::String] + # The email address of the user. + # @!attribute [rw] email_verified + # @return [::Boolean] + # Whether the email has been verified to be accessible by the user (OTP or + # similar). + # @!attribute [rw] phone_number + # @return [::String] + # The phone number of the user, with country code. + # @!attribute [rw] phone_verified + # @return [::Boolean] + # Whether the phone number has been verified to be accessible by the user + # (OTP or similar). + class User + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Line items being purchased in this transaction. + # @!attribute [rw] name + # @return [::String] + # The full name of the item. + # @!attribute [rw] value + # @return [::Float] + # The value per item that the user is paying, in the transaction currency, + # after discounts. + # @!attribute [rw] quantity + # @return [::Integer] + # The quantity of this item that is being purchased. + # @!attribute [rw] merchant_account_id + # @return [::String] + # When a merchant is specified, its corresponding account_id. Necessary to + # populate marketplace-style transactions. + class Item + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about the transaction from the gateway. + # @!attribute [rw] name + # @return [::String] + # Name of the gateway service (for example, stripe, square, paypal). + # @!attribute [rw] gateway_response_code + # @return [::String] + # Gateway response code describing the state of the transaction. + # @!attribute [rw] avs_response_code + # @return [::String] + # AVS response code from the gateway + # (available only when reCAPTCHA is called after authorization). + # @!attribute [rw] cvv_response_code + # @return [::String] + # CVV response code from the gateway + # (available only when reCAPTCHA is called after authorization). + class GatewayInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] valid + # @return [::Boolean] + # Whether the provided user response token is valid. When valid = false, the + # reason could be specified in invalid_reason or it could also be due to + # a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey + # used to generate the token was different than the one specified in the + # assessment). + # @!attribute [rw] invalid_reason + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties::InvalidReason] + # Reason associated with the response when valid = false. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp corresponding to the generation of the token. + # @!attribute [rw] hostname + # @return [::String] + # The hostname of the page on which the token was generated. + # @!attribute [rw] action + # @return [::String] + # Action name provided at token generation. + class TokenProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the types of invalid token reasons. + module InvalidReason + # Default unspecified type. + INVALID_REASON_UNSPECIFIED = 0 + + # If the failure reason was not accounted for. + UNKNOWN_INVALID_REASON = 1 + + # The provided user verification token was malformed. + MALFORMED = 2 + + # The user verification token had expired. + EXPIRED = 3 + + # The user verification had already been seen. + DUPE = 4 + + # The user verification token did not match the provided site key. + # This may be a configuration error (for example, development keys used in + # production) or end users trying to use verification tokens from other + # sites. + SITE_MISMATCH = 5 + + # The user verification token was not present. It is a required input. + MISSING = 6 + + # A retriable error (such as network failure) occurred on the browser. + # Could easily be simulated by an attacker. + BROWSER_ERROR = 7 + end + end + + # Assessment for Fraud Prevention. + # @!attribute [r] transaction_risk + # @return [::Float] + # Output only. Probability (0-1) of this transaction being fraudulent. + # Summarizes the combined risk of attack vectors below. + # @!attribute [r] stolen_instrument_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::StolenInstrumentVerdict] + # Output only. Assessment of this transaction for risk of a stolen + # instrument. + # @!attribute [r] card_testing_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::CardTestingVerdict] + # Output only. Assessment of this transaction for risk of being part of a + # card testing attack. + # @!attribute [r] behavioral_trust_verdict + # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::BehavioralTrustVerdict] + # Output only. Assessment of this transaction for behavioral trust. + class FraudPreventionAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about stolen instrument fraud, where the user is not the + # legitimate owner of the instrument being used for the purchase. + # @!attribute [r] risk + # @return [::Float] + # Output only. Probability (0-1) of this transaction being executed with a + # stolen instrument. + class StolenInstrumentVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about card testing fraud, where an adversary is testing + # fraudulently obtained cards or brute forcing their details. + # @!attribute [r] risk + # @return [::Float] + # Output only. Probability (0-1) of this transaction attempt being part of + # a card testing attack. + class CardTestingVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about behavioral trust of the transaction. + # @!attribute [r] trust + # @return [::Float] + # Output only. Probability (0-1) of this transaction attempt being executed + # in a behaviorally trustworthy way. + class BehavioralTrustVerdict + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Account defender risk assessment. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment::AccountDefenderLabel>] + # Labels for this request. + class AccountDefenderAssessment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Labels returned by account defender for this request. + module AccountDefenderLabel + # Default unspecified type. + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0 + + # The request matches a known good profile for the user. + PROFILE_MATCH = 1 + + # The request is potentially a suspicious login event and should be further + # verified either via multi-factor authentication or another system. + SUSPICIOUS_LOGIN_ACTIVITY = 2 + + # The request matched a profile that previously had suspicious account + # creation behavior. This could mean this is a fake account. + SUSPICIOUS_ACCOUNT_CREATION = 3 + + # The account in the request has a high number of related accounts. It does + # not necessarily imply that the account is bad but could require + # investigating. + RELATED_ACCOUNTS_NUMBER_HIGH = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..cd7e7ac21ad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1", path: "../" +else + gem "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb new file mode 100644 index 000000000000..878df858941e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] +require "google/cloud/recaptcha_enterprise/v1beta1" + +## +# Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment. +# +def annotate_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new + + # Call the annotate_assessment method. + result = client.annotate_assessment request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. + p result +end +# [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb new file mode 100644 index 000000000000..aeef99867e72 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] +require "google/cloud/recaptcha_enterprise/v1beta1" + +## +# Snippet for the create_assessment call in the RecaptchaEnterpriseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment. +# +def create_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new + + # Call the create_assessment method. + result = client.create_assessment request + + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. + p result +end +# [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json new file mode 100644 index 000000000000..a9c983822572 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json @@ -0,0 +1,95 @@ +{ + "client_library": { + "name": "google-cloud-recaptcha_enterprise-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync", + "title": "Snippet for the create_assessment call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment.", + "file": "recaptcha_enterprise_service/create_assessment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_assessment", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "CreateAssessment", + "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync", + "title": "Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment.", + "file": "recaptcha_enterprise_service/annotate_assessment.rb", + "language": "RUBY", + "client_method": { + "short_name": "annotate_assessment", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse", + "client": { + "short_name": "RecaptchaEnterpriseService::Client", + "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client" + }, + "method": { + "short_name": "AnnotateAssessment", + "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", + "service": { + "short_name": "RecaptchaEnterpriseService", + "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + }, + "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-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb new file mode 100644 index 000000000000..b2865dfb190e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" + +class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assessment_path project: "value0", assessment: "value1" + assert_equal "projects/value0/assessments/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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb new file mode 100644 index 000000000000..3270a52aa015 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" + + +class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment + # Create test objects. + client_result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + assessment = {} + + create_assessment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.stub :transcode_create_assessment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_assessment({ parent: parent, assessment: assessment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_assessment parent: parent, assessment: assessment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_assessment({ parent: parent, assessment: assessment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_assessment_client_stub.call_count + end + end + end + + def test_annotate_assessment + # Create test objects. + client_result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + annotation = :ANNOTATION_UNSPECIFIED + reasons = [:REASON_UNSPECIFIED] + hashed_account_id = "hello world" + transaction_event = {} + + annotate_assessment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.stub :transcode_annotate_assessment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, annotate_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.annotate_assessment name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, annotate_assessment_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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb new file mode 100644 index 000000000000..d3a7e7b9a314 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" +require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" + +class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + assessment = {} + + create_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_assessment, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment), request["assessment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_assessment({ parent: parent, assessment: assessment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_assessment parent: parent, assessment: assessment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_assessment({ parent: parent, assessment: assessment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_assessment_client_stub.call_rpc_count + end + end + + def test_annotate_assessment + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + annotation = :ANNOTATION_UNSPECIFIED + reasons = [:REASON_UNSPECIFIED] + hashed_account_id = "hello world" + transaction_event = {} + + annotate_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :annotate_assessment, name + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, request + assert_equal "hello world", request["name"] + assert_equal :ANNOTATION_UNSPECIFIED, request["annotation"] + assert_equal [:REASON_UNSPECIFIED], request["reasons"] + assert_equal "hello world", request["hashed_account_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent), request["transaction_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, annotate_assessment_client_stub do + # Create client + client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.annotate_assessment name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, annotate_assessment_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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/.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-recaptcha_enterprise/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json new file mode 100644 index 000000000000..35ab06056f92 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recaptchaenterprise.googleapis.com", + "api_shortname": "recaptchaenterprise", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise/latest", + "distribution_name": "google-cloud-recaptcha_enterprise", + "is_cloud": true, + "language": "ruby", + "name": "recaptchaenterprise", + "name_pretty": "reCAPTCHA Enterprise API", + "product_documentation": "https://cloud.google.com/recaptcha-enterprise", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse.", + "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", + "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml new file mode 100644 index 000000000000..fcb7a91bebac --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recaptcha_enterprise.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-recaptcha_enterprise.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/.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-recaptcha_enterprise/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts new file mode 100644 index 000000000000..3e6ecd16105e --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="reCAPTCHA Enterprise 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-recaptcha_enterprise/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md new file mode 100644 index 000000000000..40c7c6576a97 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recaptcha_enterprise 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-recaptcha_enterprise 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/recaptcha_enterprise" + +client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recaptcha_enterprise" + +Google::Cloud::RecaptchaEnterprise.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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-recaptcha_enterprise +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/recaptcha_enterprise" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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-recaptcha_enterprise/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile new file mode 100644 index 000000000000..c2fe33a3fa5c --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-recaptcha_enterprise-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recaptcha_enterprise.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-recaptcha_enterprise/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recaptcha_enterprise/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/README.md new file mode 100644 index 000000000000..2d7d2c76e33b --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the reCAPTCHA Enterprise API + +API Client library for the reCAPTCHA Enterprise API + +reCAPTCHA Enterprise is a service that protects your site from spam and abuse. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-recaptcha_enterprise-v*`. +The gem `google-cloud-recaptcha_enterprise` 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-recaptcha_enterprise/latest) +for this library, google-cloud-recaptcha_enterprise, 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-recaptcha_enterprise-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-recaptcha_enterprise +``` + +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/recaptchaenterprise.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/recaptcha_enterprise" + +client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service +request = ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new # (request fields as keyword arguments...) +response = client.create_assessment 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-recaptcha_enterprise-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. +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-recaptcha_enterprise-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-recaptcha_enterprise/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise/Rakefile new file mode 100644 index 000000000000..8801ccc811f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recaptcha_enterprise acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" + ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project + ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recaptcha_enterprise" + header "google-cloud-recaptcha_enterprise rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recaptcha_enterprise yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec new file mode 100644 index 000000000000..651c243ec5c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recaptcha_enterprise/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recaptcha_enterprise" + gem.version = Google::Cloud::RecaptchaEnterprise::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse." + gem.summary = "API Client library for the reCAPTCHA Enterprise 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-recaptcha_enterprise-v1", "~> 1.6" +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb new file mode 100644 index 000000000000..7a2eb0be3ece --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.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/recaptcha_enterprise" unless defined? Google::Cloud::RecaptchaEnterprise::VERSION diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb new file mode 100644 index 000000000000..41fb4337242d --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# 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/recaptcha_enterprise/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! :recaptcha_enterprise 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 RecaptchaEnterprise + ## + # Create a new client object for RecaptchaEnterpriseService. + # + # By default, this returns an instance of + # [Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest/Google-Cloud-RecaptchaEnterprise-V1-RecaptchaEnterpriseService-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 RecaptchaEnterpriseService 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 RecaptchaEnterpriseService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service_available?}. + # + # ## About RecaptchaEnterpriseService + # + # Service to determine the likelihood an event is legitimate. + # + # @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.recaptcha_enterprise_service version: :v1, &block + require "google/cloud/recaptcha_enterprise/#{version.to_s.downcase}" + + package_name = Google::Cloud::RecaptchaEnterprise + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RecaptchaEnterprise.const_get(package_name).const_get(:RecaptchaEnterpriseService) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the RecaptchaEnterpriseService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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 RecaptchaEnterpriseService service, + # or if the versioned client gem needs an update to support the RecaptchaEnterpriseService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.recaptcha_enterprise_service_available? version: :v1 + require "google/cloud/recaptcha_enterprise/#{version.to_s.downcase}" + package_name = Google::Cloud::RecaptchaEnterprise + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RecaptchaEnterprise.const_get package_name + return false unless service_module.const_defined? :RecaptchaEnterpriseService + service_module = service_module.const_get :RecaptchaEnterpriseService + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-recaptcha_enterprise 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.recaptcha_enterprise if block_given? + + ::Google::Cloud.configure.recaptcha_enterprise + end + end + end +end + +helper_path = ::File.join __dir__, "recaptcha_enterprise", "helpers.rb" +require "google/cloud/recaptcha_enterprise/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb new file mode 100644 index 000000000000..874783301b52 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb new file mode 100644 index 000000000000..8875f83e7aff --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::RecaptchaEnterprise::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_recaptcha_enterprise_service_grpc + skip unless Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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::RecaptchaEnterprise.recaptcha_enterprise_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb new file mode 100644 index 000000000000..cfc6497f1d9b --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/version" + +class Google::Cloud::RecaptchaEnterprise::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::RecaptchaEnterprise::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recommendation_engine-v1beta1/.gitignore b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..a31120e1495d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recommendationengine.googleapis.com", + "api_shortname": "recommendationengine", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest", + "distribution_name": "google-cloud-recommendation_engine-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "recommendationengine", + "name_pretty": "Recommendations AI V1beta1 API", + "product_documentation": "https://cloud.google.com/recommendations", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Recommendations AI 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-recommendation_engine-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommendation_engine instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RECOMMENDATION_ENGINE", + "ruby-cloud-product-url": "https://cloud.google.com/recommendations", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..7c6a49f34f55 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recommendation_engine-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-recommendation_engine-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/.yardopts b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts new file mode 100644 index 000000000000..5cd122719b63 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Recommendations AI 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-recommendation_engine-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..3a49ae0f7b1a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recommendation_engine-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-recommendation_engine-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/recommendation_engine/v1beta1" + +client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recommendation_engine/v1beta1" + +::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine-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/recommendation_engine/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/README.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md new file mode 100644 index 000000000000..79a867db8614 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Recommendations AI V1beta1 API + +Recommendations AI service enables customers to build end-to-end personalized recommendation systems without requiring a high level of expertise in machine learning, recommendation system, or Google Cloud. + +Recommendations AI 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 Recommendations AI V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-recommendation_engine](https://rubygems.org/gems/google-cloud-recommendation_engine). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-recommendation_engine-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/recommendationengine.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/recommendation_engine/v1beta1" + +client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new # (request fields as keyword arguments...) +response = client.create_catalog_item request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/recommendations) +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/recommendation_engine/v1beta1" +require "logger" + +client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recommendation_engine-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-recommendation_engine`. +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-recommendation_engine-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-recommendation_engine-v1beta1/Rakefile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Rakefile new file mode 100644 index 000000000000..79b970b8beea --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECOMMENDATION_ENGINE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECOMMENDATION_ENGINE_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 RECOMMENDATION_ENGINE_TEST_PROJECT=test123 RECOMMENDATION_ENGINE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECOMMENDATION_ENGINE_PROJECT"] = project + ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] = project + ENV["RECOMMENDATION_ENGINE_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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recommendation_engine-v1beta1" + header "google-cloud-recommendation_engine-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recommendation_engine-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recommendation_engine-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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..8f0427c84ac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json @@ -0,0 +1,120 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.recommendationengine.v1beta1", + "libraryPackage": "::Google::Cloud::RecommendationEngine::V1beta1", + "services": { + "CatalogService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client", + "rpcs": { + "CreateCatalogItem": { + "methods": [ + "create_catalog_item" + ] + }, + "GetCatalogItem": { + "methods": [ + "get_catalog_item" + ] + }, + "ListCatalogItems": { + "methods": [ + "list_catalog_items" + ] + }, + "UpdateCatalogItem": { + "methods": [ + "update_catalog_item" + ] + }, + "DeleteCatalogItem": { + "methods": [ + "delete_catalog_item" + ] + }, + "ImportCatalogItems": { + "methods": [ + "import_catalog_items" + ] + } + } + } + } + }, + "PredictionApiKeyRegistry": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client", + "rpcs": { + "CreatePredictionApiKeyRegistration": { + "methods": [ + "create_prediction_api_key_registration" + ] + }, + "ListPredictionApiKeyRegistrations": { + "methods": [ + "list_prediction_api_key_registrations" + ] + }, + "DeletePredictionApiKeyRegistration": { + "methods": [ + "delete_prediction_api_key_registration" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client", + "rpcs": { + "WriteUserEvent": { + "methods": [ + "write_user_event" + ] + }, + "CollectUserEvent": { + "methods": [ + "collect_user_event" + ] + }, + "ListUserEvents": { + "methods": [ + "list_user_events" + ] + }, + "PurgeUserEvents": { + "methods": [ + "purge_user_events" + ] + }, + "ImportUserEvents": { + "methods": [ + "import_user_events" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec new file mode 100644 index 000000000000..a68eb959300b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recommendation_engine/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recommendation_engine-v1beta1" + gem.version = Google::Cloud::RecommendationEngine::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Recommendations AI 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-recommendation_engine-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommendation_engine instead. See the readme for more details." + gem.summary = "Recommendations AI service enables customers to build end-to-end personalized recommendation systems without requiring a high level of expertise in machine learning, recommendation system, or 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" +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb new file mode 100644 index 000000000000..6cb219e41a0a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-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/recommendation_engine/v1beta1" diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb new file mode 100644 index 000000000000..b1f7a714c385 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/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/recommendation_engine/v1beta1/catalog_service" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" +require "google/cloud/recommendation_engine/v1beta1/prediction_service" +require "google/cloud/recommendation_engine/v1beta1/user_event_service" +require "google/cloud/recommendation_engine/v1beta1/version" + +module Google + module Cloud + module RecommendationEngine + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/recommendation_engine/v1beta1" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/recommendation_engine/v1beta1" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb new file mode 100644 index 000000000000..342d702f264e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/paths" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/operations" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/client" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for ingesting catalog information of the customer's website. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recommendation_engine/v1beta1/catalog_service" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + module CatalogService + end + end + end + end +end + +helper_path = ::File.join __dir__, "catalog_service", "helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb new file mode 100644 index 000000000000..1439b6411b77 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb @@ -0,0 +1,1028 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module CatalogService + ## + # Client for the CatalogService service. + # + # Service for ingesting catalog information of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :catalog_service_stub + + ## + # Configure the CatalogService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CatalogService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.create_catalog_item.timeout = 600.0 + default_config.rpcs.create_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_catalog_item.timeout = 600.0 + default_config.rpcs.get_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_catalog_items.timeout = 600.0 + default_config.rpcs.list_catalog_items.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_catalog_item.timeout = 600.0 + default_config.rpcs.update_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_catalog_item.timeout = 600.0 + default_config.rpcs.delete_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_catalog_items.timeout = 600.0 + default_config.rpcs.import_catalog_items.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendationengine/v1beta1/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 + + @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 + + @catalog_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RecommendationEngine::V1beta1::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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @catalog_service_stub.logger + end + + # Service calls + + ## + # Creates a catalog item. + # + # @overload create_catalog_item(request, options = nil) + # Pass arguments to `create_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_catalog_item(parent: nil, catalog_item: nil) + # Pass arguments to `create_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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`. + # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] + # Required. The catalog item to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new + # + # # Call the create_catalog_item method. + # result = client.create_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def create_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest + + # Converts hash and nil to 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_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_catalog_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :create_catalog_item, request, 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 specific catalog item. + # + # @overload get_catalog_item(request, options = nil) + # Pass arguments to `get_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_catalog_item(name: nil) + # Pass arguments to `get_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new + # + # # Call the get_catalog_item method. + # result = client.get_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def get_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :get_catalog_item, request, 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 catalog items. + # + # @overload list_catalog_items(request, options = nil) + # Pass arguments to `list_catalog_items` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_catalog_items(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_catalog_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous ListCatalogItemsResponse.next_page_token. + # @param filter [::String] + # Optional. A filter to apply on the list results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new + # + # # Call the list_catalog_items method. + # result = client.list_catalog_items request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p item + # end + # + def list_catalog_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_catalog_items.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_catalog_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :list_catalog_items, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @catalog_service_stub, :list_catalog_items, request, response, 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 catalog item. Partial updating is supported. Non-existing + # items will be created. + # + # @overload update_catalog_item(request, options = nil) + # Pass arguments to `update_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_item(name: nil, catalog_item: nil, update_mask: nil) + # Pass arguments to `update_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] + # Required. The catalog item to update/create. The 'catalog_item_id' field + # has to match that in the 'name'. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided 'item' to update. If not + # set, will by default update all fields. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new + # + # # Call the update_catalog_item method. + # result = client.update_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def update_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest + + # Converts hash and nil to 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_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :update_catalog_item, request, 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 catalog item. + # + # @overload delete_catalog_item(request, options = nil) + # Pass arguments to `delete_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_catalog_item(name: nil) + # Pass arguments to `delete_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new + # + # # Call the delete_catalog_item method. + # result = client.delete_catalog_item request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_catalog_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :delete_catalog_item, request, 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 multiple catalog items. Request processing may be + # synchronous. No partial updating supported. Non-existing items will be + # created. + # + # Operation.response is of type ImportResponse. Note that it is + # possible for a subset of the items to be successfully updated. + # + # @overload import_catalog_items(request, options = nil) + # Pass arguments to `import_catalog_items` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalog_items(parent: nil, request_id: nil, input_config: nil, errors_config: nil) + # Pass arguments to `import_catalog_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 request_id [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency and used for request deduplication. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. + # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] + # Optional. The desired location of errors incurred during the Import. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new + # + # # Call the import_catalog_items method. + # result = client.import_catalog_items request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_catalog_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest + + # Converts hash and nil to 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_catalog_items.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_catalog_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_catalog_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.call_rpc :import_catalog_items, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 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::RecommendationEngine::V1beta1::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 + # # create_catalog_item to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_catalog_item.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_catalog_item.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 `create_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :create_catalog_item + ## + # RPC-specific configuration for `get_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :get_catalog_item + ## + # RPC-specific configuration for `list_catalog_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_catalog_items + ## + # RPC-specific configuration for `update_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :update_catalog_item + ## + # RPC-specific configuration for `delete_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_catalog_item + ## + # RPC-specific configuration for `import_catalog_items` + # @return [::Gapic::Config::Method] + # + attr_reader :import_catalog_items + + # @private + def initialize parent_rpcs = nil + create_catalog_item_config = parent_rpcs.create_catalog_item if parent_rpcs.respond_to? :create_catalog_item + @create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config + get_catalog_item_config = parent_rpcs.get_catalog_item if parent_rpcs.respond_to? :get_catalog_item + @get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config + list_catalog_items_config = parent_rpcs.list_catalog_items if parent_rpcs.respond_to? :list_catalog_items + @list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config + update_catalog_item_config = parent_rpcs.update_catalog_item if parent_rpcs.respond_to? :update_catalog_item + @update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config + delete_catalog_item_config = parent_rpcs.delete_catalog_item if parent_rpcs.respond_to? :delete_catalog_item + @delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config + import_catalog_items_config = parent_rpcs.import_catalog_items if parent_rpcs.respond_to? :import_catalog_items + @import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb new file mode 100644 index 000000000000..55bb84fd8dca --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine + module V1beta1 + module CatalogService + # Credentials for the CatalogService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECOMMENDATION_ENGINE_CREDENTIALS", + "RECOMMENDATION_ENGINE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", + "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb new file mode 100644 index 000000000000..f7b7fd807de0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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 RecommendationEngine + module V1beta1 + module CatalogService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CatalogService 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 CatalogService 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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb new file mode 100644 index 000000000000..7d51dc643818 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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 RecommendationEngine + module V1beta1 + module CatalogService + # Path helper methods for the CatalogService 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 CatalogItemPath resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param catalog_item_path [String] + # + # @return [::String] + def catalog_item_path_path project:, location:, catalog:, catalog_item_path: + 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}/catalogItems/#{catalog_item_path}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb new file mode 100644 index 000000000000..462070e6da71 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/paths" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for ingesting catalog information of the customer's website. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/catalog_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb new file mode 100644 index 000000000000..14fb0c1391f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb @@ -0,0 +1,943 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module CatalogService + module Rest + ## + # REST client for the CatalogService service. + # + # Service for ingesting catalog information of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :catalog_service_stub + + ## + # Configure the CatalogService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CatalogService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.create_catalog_item.timeout = 600.0 + default_config.rpcs.create_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_catalog_item.timeout = 600.0 + default_config.rpcs.get_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_catalog_items.timeout = 600.0 + default_config.rpcs.list_catalog_items.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_catalog_item.timeout = 600.0 + default_config.rpcs.update_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_catalog_item.timeout = 600.0 + default_config.rpcs.delete_catalog_item.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_catalog_items.timeout = 600.0 + default_config.rpcs.import_catalog_items.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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 + + @operations_client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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 + + @catalog_service_stub = ::Google::Cloud::RecommendationEngine::V1beta1::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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @catalog_service_stub.logger + end + + # Service calls + + ## + # Creates a catalog item. + # + # @overload create_catalog_item(request, options = nil) + # Pass arguments to `create_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_catalog_item(parent: nil, catalog_item: nil) + # Pass arguments to `create_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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`. + # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] + # Required. The catalog item to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new + # + # # Call the create_catalog_item method. + # result = client.create_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def create_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest + + # Converts hash and nil to an 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_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_catalog_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.create_catalog_item request, 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 specific catalog item. + # + # @overload get_catalog_item(request, options = nil) + # Pass arguments to `get_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_catalog_item(name: nil) + # Pass arguments to `get_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new + # + # # Call the get_catalog_item method. + # result = client.get_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def get_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.get_catalog_item request, 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 catalog items. + # + # @overload list_catalog_items(request, options = nil) + # Pass arguments to `list_catalog_items` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_catalog_items(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_catalog_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous ListCatalogItemsResponse.next_page_token. + # @param filter [::String] + # Optional. A filter to apply on the list results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new + # + # # Call the list_catalog_items method. + # result = client.list_catalog_items request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p item + # end + # + def list_catalog_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_catalog_items.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_catalog_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.list_catalog_items request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @catalog_service_stub, :list_catalog_items, "catalog_items", request, result, 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 catalog item. Partial updating is supported. Non-existing + # items will be created. + # + # @overload update_catalog_item(request, options = nil) + # Pass arguments to `update_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, 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_item(name: nil, catalog_item: nil, update_mask: nil) + # Pass arguments to `update_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] + # Required. The catalog item to update/create. The 'catalog_item_id' field + # has to match that in the 'name'. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided 'item' to update. If not + # set, will by default update all fields. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new + # + # # Call the update_catalog_item method. + # result = client.update_catalog_item request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + # p result + # + def update_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest + + # Converts hash and nil to an 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_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.update_catalog_item request, 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 catalog item. + # + # @overload delete_catalog_item(request, options = nil) + # Pass arguments to `delete_catalog_item` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_catalog_item(name: nil) + # Pass arguments to `delete_catalog_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new + # + # # Call the delete_catalog_item method. + # result = client.delete_catalog_item request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_catalog_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest + + # Converts hash and nil to an 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_catalog_item.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_catalog_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_catalog_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.delete_catalog_item request, 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 multiple catalog items. Request processing may be + # synchronous. No partial updating supported. Non-existing items will be + # created. + # + # Operation.response is of type ImportResponse. Note that it is + # possible for a subset of the items to be successfully updated. + # + # @overload import_catalog_items(request, options = nil) + # Pass arguments to `import_catalog_items` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_catalog_items(parent: nil, request_id: nil, input_config: nil, errors_config: nil) + # Pass arguments to `import_catalog_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 request_id [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency and used for request deduplication. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. + # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] + # Optional. The desired location of errors incurred during the Import. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new + # + # # Call the import_catalog_items method. + # result = client.import_catalog_items request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_catalog_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest + + # Converts hash and nil to an 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_catalog_items.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_catalog_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_catalog_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @catalog_service_stub.import_catalog_items request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 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::RecommendationEngine::V1beta1::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 + # # create_catalog_item to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_catalog_item.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_catalog_item.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 `create_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :create_catalog_item + ## + # RPC-specific configuration for `get_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :get_catalog_item + ## + # RPC-specific configuration for `list_catalog_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_catalog_items + ## + # RPC-specific configuration for `update_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :update_catalog_item + ## + # RPC-specific configuration for `delete_catalog_item` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_catalog_item + ## + # RPC-specific configuration for `import_catalog_items` + # @return [::Gapic::Config::Method] + # + attr_reader :import_catalog_items + + # @private + def initialize parent_rpcs = nil + create_catalog_item_config = parent_rpcs.create_catalog_item if parent_rpcs.respond_to? :create_catalog_item + @create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config + get_catalog_item_config = parent_rpcs.get_catalog_item if parent_rpcs.respond_to? :get_catalog_item + @get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config + list_catalog_items_config = parent_rpcs.list_catalog_items if parent_rpcs.respond_to? :list_catalog_items + @list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config + update_catalog_item_config = parent_rpcs.update_catalog_item if parent_rpcs.respond_to? :update_catalog_item + @update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config + delete_catalog_item_config = parent_rpcs.delete_catalog_item if parent_rpcs.respond_to? :delete_catalog_item + @delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config + import_catalog_items_config = parent_rpcs.import_catalog_items if parent_rpcs.respond_to? :import_catalog_items + @import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb new file mode 100644 index 000000000000..1ada71023727 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb @@ -0,0 +1,939 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 RecommendationEngine + module V1beta1 + module CatalogService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CatalogService 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 CatalogService 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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, 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/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb new file mode 100644 index 000000000000..929ca1250ba5 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb @@ -0,0 +1,450 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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 create_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # A result object deserialized from the server's reply + def create_catalog_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_catalog_item_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_catalog_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # A result object deserialized from the server's reply + def get_catalog_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_catalog_item_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_catalog_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.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_catalog_items REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse] + # A result object deserialized from the server's reply + def list_catalog_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_catalog_items_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_catalog_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.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_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # A result object deserialized from the server's reply + def update_catalog_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_catalog_item_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.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_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_catalog_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_catalog_item_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_catalog_item", + 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 import_catalog_items REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_catalog_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_catalog_items_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_catalog_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest] + # 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_catalog_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/catalogItems", + body: "catalog_item", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_catalog_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_catalog_items REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_catalog_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/catalogItems", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest] + # 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_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{name}", + body: "catalog_item", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_catalog_item REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest] + # 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_catalog_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_catalog_items REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest] + # 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_catalog_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/catalogItems: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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb new file mode 100644 index 000000000000..488d9aad1bec --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + module PredictionApiKeyRegistry + end + end + end + end +end + +helper_path = ::File.join __dir__, "prediction_api_key_registry", "helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb new file mode 100644 index 000000000000..7171f8f90718 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb @@ -0,0 +1,693 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + ## + # Client for the PredictionApiKeyRegistry service. + # + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_api_key_registry_stub + + ## + # Configure the PredictionApiKeyRegistry Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionApiKeyRegistry clients + # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RecommendationEngine", "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.create_prediction_api_key_registration.timeout = 600.0 + default_config.rpcs.create_prediction_api_key_registration.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0 + default_config.rpcs.list_prediction_api_key_registrations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0 + default_config.rpcs.delete_prediction_api_key_registration.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 PredictionApiKeyRegistry Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam 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_api_key_registry_stub.universe_domain + end + + ## + # Create a new PredictionApiKeyRegistry client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionApiKeyRegistry 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/recommendationengine/v1beta1/prediction_apikey_registry_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 + + @prediction_api_key_registry_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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 + ) + + @prediction_api_key_registry_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 + @prediction_api_key_registry_stub.logger + end + + # Service calls + + ## + # Register an API key for use with predict method. + # + # @overload create_prediction_api_key_registration(request, options = nil) + # Pass arguments to `create_prediction_api_key_registration` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) + # Pass arguments to `create_prediction_api_key_registration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash] + # Required. The prediction API key registration. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new + # + # # Call the create_prediction_api_key_registration method. + # result = client.create_prediction_api_key_registration request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + # p result + # + def create_prediction_api_key_registration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest + + # Converts hash and nil to 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_prediction_api_key_registration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_prediction_api_key_registration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.call_rpc :create_prediction_api_key_registration, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List the registered apiKeys for use with predict method. + # + # @overload list_prediction_api_key_registrations(request, options = nil) + # Pass arguments to `list_prediction_api_key_registrations` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_prediction_api_key_registrations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 placement resource name such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If unset, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new + # + # # Call the list_prediction_api_key_registrations method. + # result = client.list_prediction_api_key_registrations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + # p item + # end + # + def list_prediction_api_key_registrations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_prediction_api_key_registrations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.call_rpc :list_prediction_api_key_registrations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @prediction_api_key_registry_stub, :list_prediction_api_key_registrations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Unregister an apiKey from using for predict method. + # + # @overload delete_prediction_api_key_registration(request, options = nil) + # Pass arguments to `delete_prediction_api_key_registration` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_prediction_api_key_registration(name: nil) + # Pass arguments to `delete_prediction_api_key_registration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The API key to unregister including full resource path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new + # + # # Call the delete_prediction_api_key_registration method. + # result = client.delete_prediction_api_key_registration request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_prediction_api_key_registration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_prediction_api_key_registration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_prediction_api_key_registration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.call_rpc :delete_prediction_api_key_registration, request, 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 PredictionApiKeyRegistry API. + # + # This class represents the configuration for PredictionApiKeyRegistry, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_prediction_api_key_registration to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 PredictionApiKeyRegistry API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_prediction_api_key_registration` + # @return [::Gapic::Config::Method] + # + attr_reader :create_prediction_api_key_registration + ## + # RPC-specific configuration for `list_prediction_api_key_registrations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_prediction_api_key_registrations + ## + # RPC-specific configuration for `delete_prediction_api_key_registration` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_prediction_api_key_registration + + # @private + def initialize parent_rpcs = nil + create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration + @create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config + list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations + @list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config + delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration + @delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb new file mode 100644 index 000000000000..52b5f39a892a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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 RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + # Credentials for the PredictionApiKeyRegistry API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECOMMENDATION_ENGINE_CREDENTIALS", + "RECOMMENDATION_ENGINE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", + "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb new file mode 100644 index 000000000000..1cf2615f5f4b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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 RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + # Path helper methods for the PredictionApiKeyRegistry API. + module Paths + ## + # Create a fully-qualified EventStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param event_store [String] + # + # @return [::String] + def event_store_path project:, location:, catalog:, event_store: + 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}/eventStores/#{event_store}" + end + + ## + # Create a fully-qualified PredictionApiKeyRegistration resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param event_store [String] + # @param prediction_api_key_registration [String] + # + # @return [::String] + def prediction_api_key_registration_path project:, location:, catalog:, event_store:, prediction_api_key_registration: + 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, "event_store cannot contain /" if event_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/eventStores/#{event_store}/predictionApiKeyRegistrations/#{prediction_api_key_registration}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb new file mode 100644 index 000000000000..516caac30c53 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + module PredictionApiKeyRegistry + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb new file mode 100644 index 000000000000..5146996f7720 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.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/errors" +require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + module Rest + ## + # REST client for the PredictionApiKeyRegistry service. + # + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_api_key_registry_stub + + ## + # Configure the PredictionApiKeyRegistry Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionApiKeyRegistry clients + # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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", "RecommendationEngine", "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.create_prediction_api_key_registration.timeout = 600.0 + default_config.rpcs.create_prediction_api_key_registration.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0 + default_config.rpcs.list_prediction_api_key_registrations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0 + default_config.rpcs.delete_prediction_api_key_registration.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 PredictionApiKeyRegistry Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_api_key_registry_stub.universe_domain + end + + ## + # Create a new PredictionApiKeyRegistry REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionApiKeyRegistry 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_api_key_registry_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @prediction_api_key_registry_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 + @prediction_api_key_registry_stub.logger + end + + # Service calls + + ## + # Register an API key for use with predict method. + # + # @overload create_prediction_api_key_registration(request, options = nil) + # Pass arguments to `create_prediction_api_key_registration` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) + # Pass arguments to `create_prediction_api_key_registration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash] + # Required. The prediction API key registration. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new + # + # # Call the create_prediction_api_key_registration method. + # result = client.create_prediction_api_key_registration request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + # p result + # + def create_prediction_api_key_registration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest + + # Converts hash and nil to an 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_prediction_api_key_registration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_prediction_api_key_registration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.create_prediction_api_key_registration request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List the registered apiKeys for use with predict method. + # + # @overload list_prediction_api_key_registrations(request, options = nil) + # Pass arguments to `list_prediction_api_key_registrations` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_prediction_api_key_registrations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 placement resource name such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If unset, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new + # + # # Call the list_prediction_api_key_registrations method. + # result = client.list_prediction_api_key_registrations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + # p item + # end + # + def list_prediction_api_key_registrations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_prediction_api_key_registrations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.list_prediction_api_key_registrations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @prediction_api_key_registry_stub, :list_prediction_api_key_registrations, "prediction_api_key_registrations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Unregister an apiKey from using for predict method. + # + # @overload delete_prediction_api_key_registration(request, options = nil) + # Pass arguments to `delete_prediction_api_key_registration` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_prediction_api_key_registration(name: nil) + # Pass arguments to `delete_prediction_api_key_registration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The API key to unregister including full resource path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + # @yield [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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new + # + # # Call the delete_prediction_api_key_registration method. + # result = client.delete_prediction_api_key_registration request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_prediction_api_key_registration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest + + # Converts hash and nil to an 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_prediction_api_key_registration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_prediction_api_key_registration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @prediction_api_key_registry_stub.delete_prediction_api_key_registration request, 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 PredictionApiKeyRegistry REST API. + # + # This class represents the configuration for PredictionApiKeyRegistry 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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 PredictionApiKeyRegistry API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_prediction_api_key_registration` + # @return [::Gapic::Config::Method] + # + attr_reader :create_prediction_api_key_registration + ## + # RPC-specific configuration for `list_prediction_api_key_registrations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_prediction_api_key_registrations + ## + # RPC-specific configuration for `delete_prediction_api_key_registration` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_prediction_api_key_registration + + # @private + def initialize parent_rpcs = nil + create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration + @create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config + list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations + @list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config + delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration + @delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb new file mode 100644 index 000000000000..21970efd2ca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + module Rest + ## + # REST service stub for the PredictionApiKeyRegistry 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_prediction_api_key_registration REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # A result object deserialized from the server's reply + def create_prediction_api_key_registration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_prediction_api_key_registration_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_prediction_api_key_registration", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.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_prediction_api_key_registrations REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse] + # A result object deserialized from the server's reply + def list_prediction_api_key_registrations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_prediction_api_key_registrations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_prediction_api_key_registrations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.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_prediction_api_key_registration REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_prediction_api_key_registration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_prediction_api_key_registration_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_prediction_api_key_registration", + 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 create_prediction_api_key_registration REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest] + # 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_prediction_api_key_registration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/predictionApiKeyRegistrations", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_prediction_api_key_registrations REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_prediction_api_key_registrations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/predictionApiKeyRegistrations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_prediction_api_key_registration REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest] + # 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_prediction_api_key_registration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/predictionApiKeyRegistrations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb new file mode 100644 index 000000000000..6606f683a13b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/prediction_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/paths" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/client" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for making recommendation prediction. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_service" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new + # + module PredictionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "prediction_service", "helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb new file mode 100644 index 000000000000..c508930ad25d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb @@ -0,0 +1,575 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionService + ## + # Client for the PredictionService service. + # + # Service for making recommendation prediction. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_service_stub + + ## + # Configure the PredictionService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "RecommendationEngine", "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.predict.timeout = 600.0 + default_config.rpcs.predict.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 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::RecommendationEngine::V1beta1::PredictionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam 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 client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PredictionService 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/recommendationengine/v1beta1/prediction_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 + + @prediction_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::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 + ) + + @prediction_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @prediction_service_stub.logger + end + + # Service calls + + ## + # Makes a recommendation prediction. If using API Key based authentication, + # the API Key must be registered using the + # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client PredictionApiKeyRegistry} + # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + # + # @overload predict(request, options = nil) + # Pass arguments to `predict` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(name: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, dry_run: 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 name [::String] + # Required. Full resource name of the format: + # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + # The id of the recommendation engine placement. This id is used to identify + # the set of models that will be used to make the prediction. + # + # We currently support three placements with the following IDs by default: + # + # * `shopping_cart`: Predicts items frequently bought together with one or + # more catalog items in the same shopping session. Commonly displayed after + # `add-to-cart` events, on product detail pages, or on the shopping cart + # page. + # + # * `home_page`: Predicts the next product that a user will most likely + # engage with or purchase based on the shopping or viewing history of the + # specified `userId` or `visitorId`. For example - Recommendations for you. + # + # * `product_detail`: Predicts the next product that a user will most likely + # engage with or purchase. The prediction is based on the shopping or + # viewing history of the specified `userId` or `visitorId` and its + # relevance to a specified `CatalogItem`. Typically used on product detail + # pages. For example - More items like this. + # + # * `recently_viewed_default`: Returns up to 75 items recently viewed by the + # specified `userId` or `visitorId`, most recent ones first. Returns + # nothing if neither of them has viewed any items yet. For example - + # Recently viewed. + # + # The full list of available placements can be seen at + # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::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. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. Set this property + # to the number of prediction results required. If zero, the service will + # choose a reasonable default. + # @param page_token [::String] + # Optional. The previous PredictResponse.next_page_token. + # @param filter [::String] + # Optional. Filter for restricting prediction results. Accepts values for + # tags and the `filterOutOfStockItems` flag. + # + # * Tag expressions. Restricts predictions to items 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 KiB. + # + # * filterOutOfStockItems. Restricts predictions to items 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 + # @param dry_run [::Boolean] + # Optional. Use dryRun mode for this prediction query. If set to true, a + # dummy model will be used that returns arbitrary catalog items. + # Note that the dryRun mode should only be used for testing the API, or if + # the model is not ready. + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # Optional. Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + # object will be returned in the + # `PredictResponse.PredictionResult.itemMetadata` object in the method + # response. + # * `returnItemScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned item will be set in the `metadata` + # field in the prediction response. The given 'score' indicates the + # probability of an item being clicked/purchased given the user's context + # and history. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels for the predict request. + # + # * Label keys can contain lowercase letters, digits and hyphens, must start + # with a letter, and must end with a letter or digit. + # * Non-zero label values can contain lowercase letters, digits and hyphens, + # must start with a letter, and must end with a letter or digit. + # * No more than 64 labels can be associated with a given request. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. + # p item + # end + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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| + response = ::Gapic::PagedEnumerable.new @prediction_service_stub, :predict, request, response, 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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb new file mode 100644 index 000000000000..1fd7c72d3267 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine + module V1beta1 + module PredictionService + # Credentials for the PredictionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECOMMENDATION_ENGINE_CREDENTIALS", + "RECOMMENDATION_ENGINE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", + "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb new file mode 100644 index 000000000000..eff694916ded --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine + module V1beta1 + module PredictionService + # Path helper methods for the PredictionService API. + module Paths + ## + # Create a fully-qualified Placement resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param event_store [String] + # @param placement [String] + # + # @return [::String] + def placement_path project:, location:, catalog:, event_store:, placement: + 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, "event_store cannot contain /" if event_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/catalogs/#{catalog}/eventStores/#{event_store}/placements/#{placement}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb new file mode 100644 index 000000000000..8138f6257d3a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/prediction_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/paths" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for making recommendation prediction. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb new file mode 100644 index 000000000000..47cda025f951 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb @@ -0,0 +1,525 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionService + module Rest + ## + # REST client for the PredictionService service. + # + # Service for making recommendation prediction. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :prediction_service_stub + + ## + # Configure the PredictionService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PredictionService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.predict.timeout = 600.0 + default_config.rpcs.predict.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @prediction_service_stub.logger + end + + # Service calls + + ## + # Makes a recommendation prediction. If using API Key based authentication, + # the API Key must be registered using the + # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client PredictionApiKeyRegistry} + # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + # + # @overload predict(request, options = nil) + # Pass arguments to `predict` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(name: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, dry_run: 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 name [::String] + # Required. Full resource name of the format: + # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + # The id of the recommendation engine placement. This id is used to identify + # the set of models that will be used to make the prediction. + # + # We currently support three placements with the following IDs by default: + # + # * `shopping_cart`: Predicts items frequently bought together with one or + # more catalog items in the same shopping session. Commonly displayed after + # `add-to-cart` events, on product detail pages, or on the shopping cart + # page. + # + # * `home_page`: Predicts the next product that a user will most likely + # engage with or purchase based on the shopping or viewing history of the + # specified `userId` or `visitorId`. For example - Recommendations for you. + # + # * `product_detail`: Predicts the next product that a user will most likely + # engage with or purchase. The prediction is based on the shopping or + # viewing history of the specified `userId` or `visitorId` and its + # relevance to a specified `CatalogItem`. Typically used on product detail + # pages. For example - More items like this. + # + # * `recently_viewed_default`: Returns up to 75 items recently viewed by the + # specified `userId` or `visitorId`, most recent ones first. Returns + # nothing if neither of them has viewed any items yet. For example - + # Recently viewed. + # + # The full list of available placements can be seen at + # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::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. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. Set this property + # to the number of prediction results required. If zero, the service will + # choose a reasonable default. + # @param page_token [::String] + # Optional. The previous PredictResponse.next_page_token. + # @param filter [::String] + # Optional. Filter for restricting prediction results. Accepts values for + # tags and the `filterOutOfStockItems` flag. + # + # * Tag expressions. Restricts predictions to items 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 KiB. + # + # * filterOutOfStockItems. Restricts predictions to items 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 + # @param dry_run [::Boolean] + # Optional. Use dryRun mode for this prediction query. If set to true, a + # dummy model will be used that returns arbitrary catalog items. + # Note that the dryRun mode should only be used for testing the API, or if + # the model is not ready. + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # Optional. Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + # object will be returned in the + # `PredictResponse.PredictionResult.itemMetadata` object in the method + # response. + # * `returnItemScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned item will be set in the `metadata` + # field in the prediction response. The given 'score' indicates the + # probability of an item being clicked/purchased given the user's context + # and history. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels for the predict request. + # + # * Label keys can contain lowercase letters, digits and hyphens, must start + # with a letter, and must end with a letter or digit. + # * Non-zero label values can contain lowercase letters, digits and hyphens, + # must start with a letter, and must end with a letter or digit. + # * No more than 64 labels can be associated with a given request. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new + # + # # Call the predict method. + # result = client.predict request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. + # p item + # end + # + def predict request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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| + result = ::Gapic::Rest::PagedEnumerable.new @prediction_service_stub, :predict, "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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb new file mode 100644 index 000000000000..d112dcff7d84 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_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/recommendationengine/v1beta1/prediction_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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: "/v1beta1/{name}:predict", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/placements/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb new file mode 100644 index 000000000000..90deba258f5d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" +require "google/cloud/recommendation_engine/v1beta1/version" + +module Google + module Cloud + module RecommendationEngine + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/recommendation_engine/v1beta1/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb new file mode 100644 index 000000000000..5fdccac0e3d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/operations" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/client" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for ingesting end user actions on the customer website. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recommendation_engine/v1beta1/user_event_service" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + module UserEventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb new file mode 100644 index 000000000000..ddb0a7f2ac6b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb @@ -0,0 +1,1009 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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 = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.write_user_event.timeout = 600.0 + default_config.rpcs.write_user_event.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.collect_user_event.timeout = 600.0 + default_config.rpcs.collect_user_event.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_user_events.timeout = 600.0 + default_config.rpcs.list_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_user_events.timeout = 600.0 + default_config.rpcs.purge_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 60.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: 60.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendationengine/v1beta1/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::RecommendationEngine::V1beta1::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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Operations] + # + attr_reader :operations_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::RecommendationEngine::V1beta1::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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) + # 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 eventStore resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent, ::Hash] + # Required. User event to write. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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. This uses a GET request to + # due to browser restriction of POST-ing to a 3rd party domain. + # + # This method is used only by the Recommendations AI JavaScript pixel. + # 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::RecommendationEngine::V1beta1::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(parent: nil, user_event: nil, uri: nil, ets: 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 parent [::String] + # Required. The parent eventStore name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto. + # @param uri [::String] + # Optional. The url including cgi-parameters but excluding the hash fragment. + # The URL must be truncated to 1.5K bytes to conservatively be under the 2K + # bytes. This is often more useful than the referer url, because many + # browsers only send the domain for 3rd party requests. + # @param ets [::Integer] + # Optional. The event timestamp in milliseconds. This prevents browser + # caching of otherwise identical get requests. The name is abbreviated to + # reduce the payload bytes. + # + # @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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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 + + ## + # Gets a list of user events within a time range, with potential filtering. + # + # @overload list_user_events(request, options = nil) + # Pass arguments to `list_user_events` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_user_events(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_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 eventStore resource name, such as + # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous ListUserEventsResponse.next_page_token. + # @param filter [::String] + # Optional. Filtering expression to specify restrictions over + # returned events. This is a sequence of terms, where each term applies some + # kind of a restriction to the returned user events. Use this expression to + # restrict results to a specific time range, or filter events by eventType. + # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + # eventTime<"2012-04-23T18:25:43.511Z" eventType=search + # + # We expect only 3 types of fields: + # + # * eventTime: this can be specified a maximum of 2 times, once with a + # less than operator and once with a greater than operator. The + # eventTime restrict should result in one contiguous valid eventTime + # range. + # + # * eventType: only 1 eventType restriction can be specified. + # + # * eventsMissingCatalogItems: specififying this will restrict results + # to events for which catalog items were not found in the catalog. The + # default behavior is to return only those events for which catalog + # items were found. + # + # Some examples of valid filters expressions: + # + # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" + # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + # eventType = detail-page-view + # * Example 3: eventsMissingCatalogItems + # eventType = search eventTime < "2018-04-23T18:30:43.511Z" + # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + # * Example 5: eventType = search + # * Example 6: eventsMissingCatalogItems + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new + # + # # Call the list_user_events method. + # result = client.list_user_events request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + # p item + # end + # + def list_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :list_user_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @user_event_service_stub, :list_user_events, request, response, operation, options + yield response, operation if block_given? + throw :response, response + 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::RecommendationEngine::V1beta1::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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 event_store under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + # @param filter [::String] + # Required. The filter string to specify the events to be deleted. Empty + # string filter is not allowed. This filter can also be used with + # ListUserEvents API to list events that will be deleted. The eligible fields + # for filtering are: + # * eventType - UserEvent.eventType field of type string. + # * eventTime - in ISO 8601 "zulu" format. + # * visitorId - field of type string. Specifying this will delete all events + # associated with a visitor. + # * userId - field of type string. Specifying this will delete all events + # associated with a user. + # Example 1: Deleting all events in a time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + # "2012-04-23T18:30:43.511Z"` + # Example 2: Deleting specific eventType in time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # Example 3: Deleting all events for a specific visitor + # `visitorId = visitor1024` + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # Optional. The default value is false. Override this flag to true to + # actually perform the purge. If the field is not set to true, a sampling of + # events to be deleted 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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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::RecommendationEngine::V1beta1::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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, request_id: 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/eventStores/default_event_store` + # @param request_id [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency for expensive long running operations. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. Note that + # this field must not be set if the desired input config is + # catalog_inline_source. + # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] + # Optional. The desired location of errors incurred during the Import. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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 + + ## + # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 `list_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_user_events + ## + # 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 + + # @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 + list_user_events_config = parent_rpcs.list_user_events if parent_rpcs.respond_to? :list_user_events + @list_user_events = ::Gapic::Config::Method.new list_user_events_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 + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb new file mode 100644 index 000000000000..65b6d6c63678 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine + module V1beta1 + module UserEventService + # Credentials for the UserEventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECOMMENDATION_ENGINE_CREDENTIALS", + "RECOMMENDATION_ENGINE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", + "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb new file mode 100644 index 000000000000..e6599fe35c8b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine + module V1beta1 + module UserEventService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RecommendationEngine::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb new file mode 100644 index 000000000000..da81c45f4fec --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_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 RecommendationEngine + module V1beta1 + module UserEventService + # Path helper methods for the UserEventService API. + module Paths + ## + # Create a fully-qualified EventStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}` + # + # @param project [String] + # @param location [String] + # @param catalog [String] + # @param event_store [String] + # + # @return [::String] + def event_store_path project:, location:, catalog:, event_store: + 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}/eventStores/#{event_store}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb new file mode 100644 index 000000000000..017cec1db63d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" + +require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentials" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + ## + # Service for ingesting end user actions on the customer website. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb new file mode 100644 index 000000000000..ced8adea21fb --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb @@ -0,0 +1,931 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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 = "recommendationengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.write_user_event.timeout = 600.0 + default_config.rpcs.write_user_event.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.collect_user_event.timeout = 600.0 + default_config.rpcs.collect_user_event.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_user_events.timeout = 600.0 + default_config.rpcs.list_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_user_events.timeout = 600.0 + default_config.rpcs.purge_user_events.retry_policy = { + initial_delay: 0.1, max_delay: 60.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: 60.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Operations] + # + attr_reader :operations_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::RecommendationEngine::V1beta1::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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) + # 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 eventStore resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent, ::Hash] + # Required. User event to write. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. This uses a GET request to + # due to browser restriction of POST-ing to a 3rd party domain. + # + # This method is used only by the Recommendations AI JavaScript pixel. + # 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::RecommendationEngine::V1beta1::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(parent: nil, user_event: nil, uri: nil, ets: 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 parent [::String] + # Required. The parent eventStore name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto. + # @param uri [::String] + # Optional. The url including cgi-parameters but excluding the hash fragment. + # The URL must be truncated to 1.5K bytes to conservatively be under the 2K + # bytes. This is often more useful than the referer url, because many + # browsers only send the domain for 3rd party requests. + # @param ets [::Integer] + # Optional. The event timestamp in milliseconds. This prevents browser + # caching of otherwise identical get requests. The name is abbreviated to + # reduce the payload bytes. + # @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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # Gets a list of user events within a time range, with potential filtering. + # + # @overload list_user_events(request, options = nil) + # Pass arguments to `list_user_events` via a request object, either of type + # {::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_user_events(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_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 eventStore resource name, such as + # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @param page_token [::String] + # Optional. The previous ListUserEventsResponse.next_page_token. + # @param filter [::String] + # Optional. Filtering expression to specify restrictions over + # returned events. This is a sequence of terms, where each term applies some + # kind of a restriction to the returned user events. Use this expression to + # restrict results to a specific time range, or filter events by eventType. + # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + # eventTime<"2012-04-23T18:25:43.511Z" eventType=search + # + # We expect only 3 types of fields: + # + # * eventTime: this can be specified a maximum of 2 times, once with a + # less than operator and once with a greater than operator. The + # eventTime restrict should result in one contiguous valid eventTime + # range. + # + # * eventType: only 1 eventType restriction can be specified. + # + # * eventsMissingCatalogItems: specififying this will restrict results + # to events for which catalog items were not found in the catalog. The + # default behavior is to return only those events for which catalog + # items were found. + # + # Some examples of valid filters expressions: + # + # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" + # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + # eventType = detail-page-view + # * Example 3: eventsMissingCatalogItems + # eventType = search eventTime < "2018-04-23T18:30:43.511Z" + # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + # * Example 5: eventType = search + # * Example 6: eventsMissingCatalogItems + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new + # + # # Call the list_user_events method. + # result = client.list_user_events request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + # p item + # end + # + def list_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.list_user_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @user_event_service_stub, :list_user_events, "user_events", request, result, 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 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::RecommendationEngine::V1beta1::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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 event_store under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + # @param filter [::String] + # Required. The filter string to specify the events to be deleted. Empty + # string filter is not allowed. This filter can also be used with + # ListUserEvents API to list events that will be deleted. The eligible fields + # for filtering are: + # * eventType - UserEvent.eventType field of type string. + # * eventTime - in ISO 8601 "zulu" format. + # * visitorId - field of type string. Specifying this will delete all events + # associated with a visitor. + # * userId - field of type string. Specifying this will delete all events + # associated with a user. + # Example 1: Deleting all events in a time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + # "2012-04-23T18:30:43.511Z"` + # Example 2: Deleting specific eventType in time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # Example 3: Deleting all events for a specific visitor + # `visitorId = visitor1024` + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # Optional. The default value is false. Override this flag to true to + # actually perform the purge. If the field is not set to true, a sampling of + # events to be deleted 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/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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, request_id: 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/eventStores/default_event_store` + # @param request_id [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency for expensive long running operations. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. Note that + # this field must not be set if the desired input config is + # catalog_inline_source. + # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] + # Required. The desired input location of the data. + # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] + # Optional. The desired location of errors incurred during the Import. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommendation_engine/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + ## + # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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 `list_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_user_events + ## + # 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 + + # @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 + list_user_events_config = parent_rpcs.list_user_events if parent_rpcs.respond_to? :list_user_events + @list_user_events = ::Gapic::Config::Method.new list_user_events_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 + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb new file mode 100644 index 000000000000..2329f9a65f28 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb @@ -0,0 +1,939 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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 RecommendationEngine + module V1beta1 + module UserEventService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "recommendationengine.googleapis.com" + + config_attr :endpoint, nil, ::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/[^/]+/catalogs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, 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/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb new file mode 100644 index 000000000000..9ec10550f3fd --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_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/recommendationengine/v1beta1/user_event_service_pb" + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 list_user_events REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse] + # A result object deserialized from the server's reply + def list_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_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: "list_user_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 + + ## + # @private + # + # GRPC transcoding helper method for the write_user_event REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:write", + body: "user_event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the collect_user_event REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:collect", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_user_events REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/userEvents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_user_events REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_user_events REST call + # + # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb new file mode 100644 index 000000000000..a09600872115 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/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 RecommendationEngine + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb new file mode 100644 index 000000000000..bd0faa39115e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/catalog.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/recommendationengine/v1beta1/common_pb' + + +descriptor_data = "\n7google/cloud/recommendationengine/v1beta1/catalog.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x36google/cloud/recommendationengine/v1beta1/common.proto\"\xfe\x03\n\x0b\x43\x61talogItem\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12k\n\x14\x63\x61tegory_hierarchies\x18\x02 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12S\n\x0fitem_attributes\x18\x05 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\ritem_group_id\x18\t \x01(\tB\x03\xe0\x41\x01\x12^\n\x10product_metadata\x18\n \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ProductCatalogItemB\x03\xe0\x41\x01H\x00\x1a,\n\x11\x43\x61tegoryHierarchy\x12\x17\n\ncategories\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x15\n\x13recommendation_type\"\xe6\x06\n\x12ProductCatalogItem\x12\x64\n\x0b\x65xact_price\x18\x01 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceB\x03\xe0\x41\x01H\x00\x12\x64\n\x0bprice_range\x18\x02 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeB\x03\xe0\x41\x01H\x00\x12\\\n\x05\x63osts\x18\x03 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.CostsEntryB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x62\n\x0bstock_state\x18\x05 \x01(\x0e\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockStateB\x03\xe0\x41\x01\x12\x1f\n\x12\x61vailable_quantity\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12\"\n\x15\x63\x61nonical_product_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x06images\x18\x08 \x03(\x0b\x32\x30.google.cloud.recommendationengine.v1beta1.ImageB\x03\xe0\x41\x01\x1a\x45\n\nExactPrice\x12\x1a\n\rdisplay_price\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01\x12\x1b\n\x0eoriginal_price\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x1a\x30\n\nPriceRange\x12\x10\n\x03min\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x12\x10\n\x03max\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x1a,\n\nCostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\"j\n\nStockState\x12\x1b\n\x17STOCK_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08IN_STOCK\x10\x00\x12\x10\n\x0cOUT_OF_STOCK\x10\x01\x12\x0c\n\x08PREORDER\x10\x02\x12\r\n\tBACKORDER\x10\x03\x1a\x02\x10\x01\x42\x07\n\x05price\"B\n\x05Image\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06height\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05width\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.FeatureMap", "google/cloud/recommendationengine/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 RecommendationEngine + module V1beta1 + CatalogItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogItem").msgclass + CatalogItem::CategoryHierarchy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy").msgclass + ProductCatalogItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem").msgclass + ProductCatalogItem::ExactPrice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice").msgclass + ProductCatalogItem::PriceRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange").msgclass + ProductCatalogItem::StockState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState").enummodule + Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.Image").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb new file mode 100644 index 000000000000..36f588521374 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/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/recommendationengine/v1beta1/catalog_pb' +require 'google/cloud/recommendationengine/v1beta1/import_pb' +require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n?google/cloud/recommendationengine/v1beta1/catalog_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a\x36google/cloud/recommendationengine/v1beta1/import.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb2\x01\n\x18\x43reateCatalogItemRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\"b\n\x15GetCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\"\xa4\x01\n\x17ListCatalogItemsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.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\"\x82\x01\n\x18ListCatalogItemsResponse\x12M\n\rcatalog_items\x18\x01 \x03(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe9\x01\n\x18UpdateCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"e\n\x18\x44\x65leteCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath2\x96\r\n\x0e\x43\x61talogService\x12\xfe\x01\n\x11\x43reateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"l\xda\x41\x13parent,catalog_item\x82\xd3\xe4\x93\x02P\"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:\x0c\x63\x61talog_item\x12\xdc\x01\n\x0eGetCatalogItem\x12@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\x12\xf5\x01\n\x10ListCatalogItems\x12\x42.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest\x1a\x43.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse\"X\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02\x42\x12@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems\x12\x89\x02\n\x11UpdateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"w\xda\x41\x1dname,catalog_item,update_mask\x82\xd3\xe4\x93\x02Q2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}:\x0c\x63\x61talog_item\x12\xc2\x01\n\x11\x44\x65leteCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest\x1a\x16.google.protobuf.Empty\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\x12\x81\x03\n\x12ImportCatalogItems\x12\x44.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest\x1a\x1d.google.longrunning.Operation\"\x85\x02\xca\x41\x80\x01\nDgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse\x12\x38google.cloud.recommendationengine.v1beta1.ImportMetadata\xda\x41,parent,request_id,input_config,errors_config\x82\xd3\xe4\x93\x02L\"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.CatalogItem", "google/cloud/recommendationengine/v1beta1/catalog.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 RecommendationEngine + module V1beta1 + CreateCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest").msgclass + GetCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest").msgclass + ListCatalogItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest").msgclass + ListCatalogItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse").msgclass + UpdateCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest").msgclass + DeleteCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb new file mode 100644 index 000000000000..998d8ba8cbec --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recommendationengine/v1beta1/catalog_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/catalog_service_pb' + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module CatalogService + # Service for ingesting catalog 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.recommendationengine.v1beta1.CatalogService' + + # Creates a catalog item. + rpc :CreateCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem + # Gets a specific catalog item. + rpc :GetCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem + # Gets a list of catalog items. + rpc :ListCatalogItems, ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse + # Updates a catalog item. Partial updating is supported. Non-existing + # items will be created. + rpc :UpdateCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem + # Deletes a catalog item. + rpc :DeleteCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Google::Protobuf::Empty + # Bulk import of multiple catalog items. Request processing may be + # synchronous. No partial updating supported. Non-existing items will be + # created. + # + # Operation.response is of type ImportResponse. Note that it is + # possible for a subset of the items to be successfully updated. + rpc :ImportCatalogItems, ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb new file mode 100644 index 000000000000..e53451a89378 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/common.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/recommendationengine/v1beta1/common.proto\x12)google.cloud.recommendationengine.v1beta1\"\x96\x04\n\nFeatureMap\x12l\n\x14\x63\x61tegorical_features\x18\x01 \x03(\x0b\x32N.google.cloud.recommendationengine.v1beta1.FeatureMap.CategoricalFeaturesEntry\x12h\n\x12numerical_features\x18\x02 \x03(\x0b\x32L.google.cloud.recommendationengine.v1beta1.FeatureMap.NumericalFeaturesEntry\x1a\x1b\n\nStringList\x12\r\n\x05value\x18\x01 \x03(\t\x1a\x1a\n\tFloatList\x12\r\n\x05value\x18\x01 \x03(\x02\x1a|\n\x18\x43\x61tegoricalFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12O\n\x05value\x18\x02 \x01(\x0b\x32@.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList:\x02\x38\x01\x1ay\n\x16NumericalFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList:\x02\x38\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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 = [ + ] + 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 RecommendationEngine + module V1beta1 + FeatureMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap").msgclass + FeatureMap::StringList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap.StringList").msgclass + FeatureMap::FloatList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb new file mode 100644 index 000000000000..14c719639702 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/import.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/recommendationengine/v1beta1/catalog_pb' +require 'google/cloud/recommendationengine/v1beta1/user_event_pb' +require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n6google/cloud/recommendationengine/v1beta1/import.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"$\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\"i\n\x13\x43\x61talogInlineSource\x12R\n\rcatalog_items\x18\x01 \x03(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x01\"g\n\x15UserEventInlineSource\x12N\n\x0buser_events\x18\x01 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x01\"9\n\x12ImportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xa7\x02\n\x19ImportCatalogItemsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x0cinput_config\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.InputConfigB\x03\xe0\x41\x02\x12Y\n\rerrors_config\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigB\x03\xe0\x41\x01\"\xa8\x02\n\x17ImportUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x0cinput_config\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.InputConfigB\x03\xe0\x41\x02\x12Y\n\rerrors_config\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigB\x03\xe0\x41\x01\"\xaa\x02\n\x0bInputConfig\x12_\n\x15\x63\x61talog_inline_source\x18\x01 \x01(\x0b\x32>.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceH\x00\x12J\n\ngcs_source\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.GcsSourceH\x00\x12\x64\n\x18user_event_inline_source\x18\x03 \x01(\x0b\x32@.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceH\x00\x42\x08\n\x06source\"\xcc\x01\n\x0eImportMetadata\x12\x16\n\x0eoperation_name\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x01 \x01(\x03\x12\x15\n\rfailure_count\x18\x02 \x01(\x03\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9d\x01\n\x1aImportCatalogItemsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12T\n\rerrors_config\x18\x02 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig\"\xf6\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12T\n\rerrors_config\x18\x02 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig\x12Y\n\x0eimport_summary\x18\x03 \x01(\x0b\x32\x41.google.cloud.recommendationengine.v1beta1.UserEventImportSummary\"T\n\x16UserEventImportSummary\x12\x1b\n\x13joined_events_count\x18\x01 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x02 \x01(\x03\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.CatalogItem", "google/cloud/recommendationengine/v1beta1/catalog.proto"], + ["google.cloud.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/user_event.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 RecommendationEngine + module V1beta1 + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.GcsSource").msgclass + CatalogInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogInlineSource").msgclass + UserEventInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEventInlineSource").msgclass + ImportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportErrorsConfig").msgclass + ImportCatalogItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest").msgclass + ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.InputConfig").msgclass + ImportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportMetadata").msgclass + ImportCatalogItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse").msgclass + ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse").msgclass + UserEventImportSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEventImportSummary").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb new file mode 100644 index 000000000000..19d727b56e92 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/empty_pb' +require 'google/api/client_pb' +require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' + + +descriptor_data = "\nRgoogle/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/api/client.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\"/\n\x1cPredictionApiKeyRegistration\x12\x0f\n\x07\x61pi_key\x18\x01 \x01(\t\"\xea\x01\n)CreatePredictionApiKeyRegistrationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12u\n\x1fprediction_api_key_registration\x18\x02 \x01(\x0b\x32G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationB\x03\xe0\x41\x02\"\xa3\x01\n(ListPredictionApiKeyRegistrationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\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\"\xb7\x01\n)ListPredictionApiKeyRegistrationsResponse\x12q\n prediction_api_key_registrations\x18\x01 \x03(\x0b\x32G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x83\x01\n)DeletePredictionApiKeyRegistrationRequest\x12V\n\x04name\x18\x01 \x01(\tBH\xe0\x41\x02\xfa\x41\x42\n@recommendationengine.googleapis.com/PredictionApiKeyRegistration2\x97\x08\n\x18PredictionApiKeyRegistry\x12\xd9\x02\n\"CreatePredictionApiKeyRegistration\x12T.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest\x1aG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration\"\x93\x01\xda\x41&parent,prediction_api_key_registration\x82\xd3\xe4\x93\x02\x64\"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:\x01*\x12\xc0\x02\n!ListPredictionApiKeyRegistrations\x12S.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest\x1aT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations\x12\x82\x02\n\"DeletePredictionApiKeyRegistration\x12T.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest\x1a\x16.google.protobuf.Empty\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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 = [ + ] + 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 RecommendationEngine + module V1beta1 + PredictionApiKeyRegistration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration").msgclass + CreatePredictionApiKeyRegistrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest").msgclass + ListPredictionApiKeyRegistrationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest").msgclass + ListPredictionApiKeyRegistrationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse").msgclass + DeletePredictionApiKeyRegistrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb new file mode 100644 index 000000000000..a5afee34ea66 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/prediction_apikey_registry_service_pb' + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + module PredictionApiKeyRegistry + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' + + # Register an API key for use with predict method. + rpc :CreatePredictionApiKeyRegistration, ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration + # List the registered apiKeys for use with predict method. + rpc :ListPredictionApiKeyRegistrations, ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse + # Unregister an apiKey from using for predict method. + rpc :DeletePredictionApiKeyRegistration, ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb new file mode 100644 index 000000000000..7f9d53765c4f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/prediction_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/recommendationengine/v1beta1/user_event_pb' +require 'google/protobuf/struct_pb' +require 'google/api/client_pb' + + +descriptor_data = "\nBgoogle/cloud/recommendationengine/v1beta1/prediction_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/api/client.proto\"\xae\x04\n\x0ePredictRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recommendationengine.googleapis.com/Placement\x12M\n\nuser_event\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x64ry_run\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12Z\n\x06params\x18\x06 \x03(\x0b\x32\x45.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryB\x03\xe0\x41\x01\x12Z\n\x06labels\x18\t \x03(\x0b\x32\x45.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryB\x03\xe0\x41\x01\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\"\xe2\x04\n\x0fPredictResponse\x12\\\n\x07results\x18\x01 \x03(\x0b\x32K.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult\x12\x1c\n\x14recommendation_token\x18\x02 \x01(\t\x12 \n\x18items_missing_in_catalog\x18\x03 \x03(\t\x12\x0f\n\x07\x64ry_run\x18\x04 \x01(\x08\x12Z\n\x08metadata\x18\x05 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.PredictResponse.MetadataEntry\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x1a\xe1\x01\n\x10PredictionResult\x12\n\n\x02id\x18\x01 \x01(\t\x12t\n\ritem_metadata\x18\x02 \x03(\x0b\x32].google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.ItemMetadataEntry\x1aK\n\x11ItemMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\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\xe2\x02\n\x11PredictionService\x12\xf3\x01\n\x07Predict\x12\x39.google.cloud.recommendationengine.v1beta1.PredictRequest\x1a:.google.cloud.recommendationengine.v1beta1.PredictResponse\"q\xda\x41\x0fname,user_event\x82\xd3\xe4\x93\x02Y\"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/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 RecommendationEngine + module V1beta1 + PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictRequest").msgclass + PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictResponse").msgclass + PredictResponse::PredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb new file mode 100644 index 000000000000..92327ca424a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recommendationengine/v1beta1/prediction_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/prediction_service_pb' + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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.recommendationengine.v1beta1.PredictionService' + + # Makes a recommendation prediction. If using API Key based authentication, + # the API Key must be registered using the + # [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + rpc :Predict, ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest, ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb new file mode 100644 index 000000000000..00049d9e3c79 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\nNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x19google/api/resource.protoB\xac\x08\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::V1beta1\xea\x41i\n+recommendationengine.googleapis.com/Catalog\x12:projects/{project}/locations/{location}/catalogs/{catalog}\xea\x41\x92\x01\n3recommendationengine.googleapis.com/CatalogItemPath\x12[projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}\xea\x41\x86\x01\n.recommendationengine.googleapis.com/EventStore\x12Tprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}\xea\x41\xd9\x01\n@recommendationengine.googleapis.com/PredictionApiKeyRegistration\x12\x94\x01projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}\xea\x41\x9c\x01\n-recommendationengine.googleapis.com/Placement\x12kprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}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 RecommendationEngine + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb new file mode 100644 index 000000000000..31d5869ee1c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/user_event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/recommendationengine/v1beta1/catalog_pb' +require 'google/cloud/recommendationengine/v1beta1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n:google/cloud/recommendationengine/v1beta1/user_event.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a\x36google/cloud/recommendationengine/v1beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x92\x04\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\tuser_info\x18\x02 \x01(\x0b\x32\x33.google.cloud.recommendationengine.v1beta1.UserInfoB\x03\xe0\x41\x02\x12Q\n\x0c\x65vent_detail\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.EventDetailB\x03\xe0\x41\x01\x12`\n\x14product_event_detail\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ProductEventDetailB\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12[\n\x0c\x65vent_source\x18\x06 \x01(\x0e\x32@.google.cloud.recommendationengine.v1beta1.UserEvent.EventSourceB\x03\xe0\x41\x01\"X\n\x0b\x45ventSource\x12\x1c\n\x18\x45VENT_SOURCE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41UTOML\x10\x01\x12\r\n\tECOMMERCE\x10\x02\x12\x10\n\x0c\x42\x41TCH_UPLOAD\x10\x03\"\x8d\x01\n\x08UserInfo\x12\x17\n\nvisitor_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07user_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nip_address\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x64irect_user_request\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x01\n\x0b\x45ventDetail\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0creferrer_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpage_view_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65xperiment_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12!\n\x14recommendation_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12T\n\x10\x65vent_attributes\x18\x05 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\"\xea\x02\n\x12ProductEventDetail\x12\x14\n\x0csearch_query\x18\x01 \x01(\t\x12\x61\n\x0fpage_categories\x18\x02 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy\x12Q\n\x0fproduct_details\x18\x03 \x03(\x0b\x32\x38.google.cloud.recommendationengine.v1beta1.ProductDetail\x12\x0f\n\x07list_id\x18\x04 \x01(\t\x12\x14\n\x07\x63\x61rt_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x61\n\x14purchase_transaction\x18\x06 \x01(\x0b\x32>.google.cloud.recommendationengine.v1beta1.PurchaseTransactionB\x03\xe0\x41\x01\"\xf2\x02\n\x13PurchaseTransaction\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07revenue\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x12]\n\x05taxes\x18\x03 \x03(\x0b\x32I.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.TaxesEntryB\x03\xe0\x41\x01\x12]\n\x05\x63osts\x18\x04 \x03(\x0b\x32I.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.CostsEntryB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x06 \x01(\tB\x03\xe0\x41\x02\x1a,\n\nTaxesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a,\n\nCostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\"\xe6\x02\n\rProductDetail\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcurrency_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0eoriginal_price\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01\x12\x1a\n\rdisplay_price\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01\x12\x62\n\x0bstock_state\x18\x05 \x01(\x0e\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockStateB\x03\xe0\x41\x01\x12\x15\n\x08quantity\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61vailable_quantity\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x0fitem_attributes\x18\x08 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.FeatureMap", "google/cloud/recommendationengine/v1beta1/common.proto"], + ["google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy", "google/cloud/recommendationengine/v1beta1/catalog.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 RecommendationEngine + module V1beta1 + UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEvent").msgclass + UserEvent::EventSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEvent.EventSource").enummodule + UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserInfo").msgclass + EventDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.EventDetail").msgclass + ProductEventDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductEventDetail").msgclass + PurchaseTransaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurchaseTransaction").msgclass + ProductDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductDetail").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb new file mode 100644 index 000000000000..a0a2f6643207 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommendationengine/v1beta1/user_event_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/cloud/recommendationengine/v1beta1/import_pb' +require 'google/cloud/recommendationengine/v1beta1/user_event_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' +require 'google/api/client_pb' + + +descriptor_data = "\nBgoogle/cloud/recommendationengine/v1beta1/user_event_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/recommendationengine/v1beta1/import.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/api/client.proto\"\x89\x01\n\x16PurgeUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x17PurgeUserEventsMetadata\x12\x16\n\x0eoperation_name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x88\x01\n\x17PurgeUserEventsResponse\x12\x1b\n\x13purged_events_count\x18\x01 \x01(\x03\x12P\n\x12user_events_sample\x18\x02 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEvent\"\xae\x01\n\x15WriteUserEventRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12M\n\nuser_event\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x02\"\x9e\x01\n\x17\x43ollectUserEventRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03\x65ts\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\"\xa5\x01\n\x15ListUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\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\"|\n\x16ListUserEventsResponse\x12I\n\x0buser_events\x18\x01 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEvent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd8\x0c\n\x10UserEventService\x12\x84\x02\n\x0eWriteUserEvent\x12@.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest\x1a\x34.google.cloud.recommendationengine.v1beta1.UserEvent\"z\xda\x41\x11parent,user_event\x82\xd3\xe4\x93\x02`\"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write:\nuser_event\x12\xe6\x01\n\x10\x43ollectUserEvent\x12\x42.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"x\xda\x41\x19parent,user_event,uri,ets\x82\xd3\xe4\x93\x02V\x12T/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect\x12\xfb\x01\n\x0eListUserEvents\x12@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest\x1a\x41.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse\"d\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02N\x12L/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents\x12\xf3\x02\n\x0fPurgeUserEvents\x12\x41.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xfd\x01\xca\x41\x86\x01\nAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse\x12\x41google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata\xda\x41\x13parent,filter,force\x82\xd3\xe4\x93\x02W\"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:\x01*\x12\x86\x03\n\x10ImportUserEvents\x12\x42.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x02\xca\x41~\nBgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse\x12\x38google.cloud.recommendationengine.v1beta1.ImportMetadata\xda\x41,parent,request_id,input_config,errors_config\x82\xd3\xe4\x93\x02X\"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/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 RecommendationEngine + module V1beta1 + PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest").msgclass + PurgeUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata").msgclass + PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse").msgclass + WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.WriteUserEventRequest").msgclass + CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CollectUserEventRequest").msgclass + ListUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListUserEventsRequest").msgclass + ListUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListUserEventsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb new file mode 100644 index 000000000000..c8f9605da343 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recommendationengine/v1beta1/user_event_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/user_event_service_pb' + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + 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.recommendationengine.v1beta1.UserEventService' + + # Writes a single user event. + rpc :WriteUserEvent, ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest, ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent + # Writes a single user event from the browser. This uses a GET request to + # due to browser restriction of POST-ing to a 3rd party domain. + # + # This method is used only by the Recommendations AI JavaScript pixel. + # Users should not call this method directly. + rpc :CollectUserEvent, ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest, ::Google::Api::HttpBody + # Gets a list of user events within a time range, with potential filtering. + rpc :ListUserEvents, ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse + # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::ImportUserEventsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..cf12167c2a75 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Recommendations AI 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-recommendation_engine-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..938f7ac6b2fd --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb new file mode 100644 index 000000000000..f3ea16e814c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb @@ -0,0 +1,218 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # CatalogItem captures all metadata information of items to be recommended. + # @!attribute [rw] id + # @return [::String] + # Required. Catalog item identifier. UTF-8 encoded string with a length limit + # of 128 bytes. + # + # This id must be unique among all catalog items within the same catalog. It + # should also be used when logging user events in order for the user events + # to be joined with the Catalog. + # @!attribute [rw] category_hierarchies + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem::CategoryHierarchy>] + # Required. Catalog item categories. This field is repeated for supporting + # one catalog item belonging to several parallel category hierarchies. + # + # For example, if a shoes product belongs to both + # ["Shoes & Accessories" -> "Shoes"] and + # ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + # represented as: + # + # "categoryHierarchies": [ + # { "categories": ["Shoes & Accessories", "Shoes"]}, + # { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + # ] + # @!attribute [rw] title + # @return [::String] + # Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + # KiB. + # @!attribute [rw] description + # @return [::String] + # Optional. Catalog item description. UTF-8 encoded string with a length + # limit of 5 KiB. + # @!attribute [rw] item_attributes + # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] + # Optional. Highly encouraged. Extra catalog item attributes to be + # included in the recommendation model. For example, for retail 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 item attributes here. + # @!attribute [rw] language_code + # @return [::String] + # Optional. Language of the title/description/item_attributes. Use language + # tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + # supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + # 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + # your Google account manager. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. Filtering tags associated with the catalog item. Each tag should + # be a UTF-8 encoded string with a length limit of 1 KiB. + # + # This tag can be used for filtering recommendation results by passing the + # tag as part of the predict request filter. + # @!attribute [rw] item_group_id + # @return [::String] + # Optional. Variant group identifier for prediction results. UTF-8 encoded + # string with a length limit of 128 bytes. + # + # This field must be enabled before it can be used. [Learn + # more](/recommendations-ai/docs/catalog#item-group-id). + # @!attribute [rw] product_metadata + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem] + # Optional. Metadata specific to retail products. + class CatalogItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Category represents catalog item category hierarchy. + # @!attribute [rw] categories + # @return [::Array<::String>] + # Required. Catalog item categories. Each category should be a UTF-8 + # encoded string with a length limit of 2 KiB. + # + # Note that the order in the list denotes the specificity (from least to + # most specific). + class CategoryHierarchy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ProductCatalogItem captures item metadata specific to retail products. + # @!attribute [rw] exact_price + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::ExactPrice] + # Optional. The exact product price. + # + # Note: The following fields are mutually exclusive: `exact_price`, `price_range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] price_range + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::PriceRange] + # Optional. The product price range. + # + # Note: The following fields are mutually exclusive: `price_range`, `exact_price`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] costs + # @return [::Google::Protobuf::Map{::String => ::Float}] + # Optional. A map to pass the costs associated with the product. + # + # For example: + # \\{"manufacturing": 45.5} The profit of selling this item is computed like + # so: + # + # * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + # * If 'priceRange' is provided, profit = minPrice - sum(costs) + # @!attribute [rw] currency_code + # @return [::String] + # Optional. Only required if the price is set. Currency code for price/costs. Use + # three-character ISO-4217 code. + # @!attribute [rw] stock_state + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState] + # Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + # @!attribute [rw] available_quantity + # @return [::Integer] + # Optional. The available quantity of the item. + # @!attribute [rw] canonical_product_uri + # @return [::String] + # Optional. Canonical URL directly linking to the item detail page with a + # length limit of 5 KiB.. + # @!attribute [rw] images + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::Image>] + # Optional. Product images for the catalog item. + class ProductCatalogItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Exact product price. + # @!attribute [rw] display_price + # @return [::Float] + # Optional. Display price of the product. + # @!attribute [rw] original_price + # @return [::Float] + # Optional. Price of the product without any discount. If zero, by default + # set to be the 'displayPrice'. + class ExactPrice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Product price range when there are a range of prices for different + # variations of the same product. + # @!attribute [rw] min + # @return [::Float] + # Required. The minimum product price. + # @!attribute [rw] max + # @return [::Float] + # Required. The maximum product price. + class PriceRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class CostsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Item stock state. If this field is unspecified, the item is + # assumed to be in stock. + module StockState + # Default item stock status. Should never be used. + STOCK_STATE_UNSPECIFIED = 0 + + # Item in stock. + IN_STOCK = 0 + + # Item out of stock. + OUT_OF_STOCK = 1 + + # Item that is in pre-order state. + PREORDER = 2 + + # Item that is back-ordered (i.e. temporarily out of stock). + BACKORDER = 3 + end + end + + # Catalog item thumbnail/detail image. + # @!attribute [rw] uri + # @return [::String] + # Required. URL of the image with a length limit of 5 KiB. + # @!attribute [rw] height + # @return [::Integer] + # Optional. Height of the image in number of pixels. + # @!attribute [rw] width + # @return [::Integer] + # Optional. Width of the image in number of pixels. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb new file mode 100644 index 000000000000..21e34edb82fc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # Request message for CreateCatalogItem method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @!attribute [rw] catalog_item + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # Required. The catalog item to create. + class CreateCatalogItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetCatalogItem method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + class GetCatalogItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListCatalogItems method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent catalog resource name, such as + # `projects/*/locations/global/catalogs/default_catalog`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The previous ListCatalogItemsResponse.next_page_token. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter to apply on the list results. + class ListCatalogItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListCatalogItems method. + # @!attribute [rw] catalog_items + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # The catalog items. + # @!attribute [rw] next_page_token + # @return [::String] + # If empty, the list is complete. If nonempty, the token to pass to the next + # request's ListCatalogItemRequest.page_token. + class ListCatalogItemsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateCatalogItem method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + # @!attribute [rw] catalog_item + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] + # Required. The catalog item to update/create. The 'catalog_item_id' field + # has to match that in the 'name'. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Indicates which fields in the provided 'item' to update. If not + # set, will by default update all fields. + class UpdateCatalogItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteCatalogItem method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of catalog item, such as + # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + class DeleteCatalogItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb new file mode 100644 index 000000000000..0e2cc12edef0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # FeatureMap represents extra features that customers want to include in the + # recommendation model for catalogs/user events as categorical/numerical + # features. + # @!attribute [rw] categorical_features + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::StringList}] + # Categorical features that can take on one of a limited number of possible + # values. Some examples would be the brand/maker of a product, or country of + # a customer. + # + # Feature names and values must be UTF-8 encoded strings. + # + # For example: `{ "colors": {"value": ["yellow", "green"]}, + # "sizes": \\{"value":["S", "M"]}` + # @!attribute [rw] numerical_features + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::FloatList}] + # Numerical features. Some examples would be the height/weight of a product, + # or age of a customer. + # + # Feature names must be UTF-8 encoded strings. + # + # For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + # "heights_cm": \\{"value":[8.1, 6.4]} }` + class FeatureMap + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A list of string features. + # @!attribute [rw] value + # @return [::Array<::String>] + # String feature value with a length limit of 128 bytes. + class StringList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of float features. + # @!attribute [rw] value + # @return [::Array<::Float>] + # Float feature value. + class FloatList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::StringList] + class CategoricalFeaturesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::FloatList] + class NumericalFeaturesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb new file mode 100644 index 000000000000..612e5cbdaa66 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # Google Cloud Storage location for input content. + # format. + # @!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 catalog information](/recommendations-ai/docs/upload-catalog) + # for the expected file format and setup instructions. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The inline source for the input config for ImportCatalogItems method. + # @!attribute [rw] catalog_items + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] + # Optional. A list of catalog items to update/create. Recommended max of 10k + # items. + class CatalogInlineSource + 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::RecommendationEngine::V1beta1::UserEvent>] + # Optional. 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 path for import errors. This must be an empty, + # existing Cloud Storage bucket. Import errors will be written to a file in + # this bucket, 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` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency and used for request deduplication. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. + # @!attribute [rw] input_config + # @return [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig] + # Required. The desired input location of the data. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig] + # Optional. The desired location of errors incurred during the Import. + class ImportCatalogItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the ImportUserEvents request. + # @!attribute [rw] parent + # @return [::String] + # Required. + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Unique identifier provided by client, within the ancestor + # dataset scope. Ensures idempotency for expensive long running operations. + # Server-generated if unspecified. Up to 128 characters long. This is + # returned as google.longrunning.Operation.name in the response. Note that + # this field must not be set if the desired input config is + # catalog_inline_source. + # @!attribute [rw] input_config + # @return [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig] + # Required. The desired input location of the data. + # @!attribute [rw] errors_config + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig] + # Optional. The desired location of errors incurred during the Import. + class ImportUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input config source. + # @!attribute [rw] catalog_inline_source + # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogInlineSource] + # The Inline source for the input content for Catalog items. + # + # Note: The following fields are mutually exclusive: `catalog_inline_source`, `gcs_source`, `user_event_inline_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::RecommendationEngine::V1beta1::GcsSource] + # Google Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `catalog_inline_source`, `user_event_inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_event_inline_source + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventInlineSource] + # The Inline source for the input content for UserEvents. + # + # Note: The following fields are mutually exclusive: `user_event_inline_source`, `catalog_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the Import operation. This will be + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] operation_name + # @return [::String] + # Name of the operation. + # @!attribute [rw] request_id + # @return [::String] + # Id of the request / operation. This is parroting back the requestId that + # was passed in the request. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create 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] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class ImportMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the ImportCatalogItemsRequest. 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::RecommendationEngine::V1beta1::ImportErrorsConfig] + # Echoes the destination for the complete errors in the request if set. + class ImportCatalogItemsResponse + 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::RecommendationEngine::V1beta1::ImportErrorsConfig] + # Echoes the destination for the complete errors if this field was set in + # the request. + # @!attribute [rw] import_summary + # @return [::Google::Cloud::RecommendationEngine::V1beta1::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 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb new file mode 100644 index 000000000000..9947c1867d66 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # Registered Api Key. + # @!attribute [rw] api_key + # @return [::String] + # The API key. + class PredictionApiKeyRegistration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreatePredictionApiKeyRegistration` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @!attribute [rw] prediction_api_key_registration + # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] + # Required. The prediction API key registration. + class CreatePredictionApiKeyRegistrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListPredictionApiKeyRegistrations`. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent placement resource name such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return per page. If unset, the + # service will choose a reasonable default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + class ListPredictionApiKeyRegistrationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListPredictionApiKeyRegistrations`. + # @!attribute [rw] prediction_api_key_registrations + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] + # The list of registered API keys. + # @!attribute [rw] next_page_token + # @return [::String] + # If empty, the list is complete. If nonempty, pass the token to the next + # request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + class ListPredictionApiKeyRegistrationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `DeletePredictionApiKeyRegistration` method. + # @!attribute [rw] name + # @return [::String] + # Required. The API key to unregister including full resource path. + # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + class DeletePredictionApiKeyRegistrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb new file mode 100644 index 000000000000..dfbb8aab0ce7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # Request message for Predict method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of the format: + # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + # The id of the recommendation engine placement. This id is used to identify + # the set of models that will be used to make the prediction. + # + # We currently support three placements with the following IDs by default: + # + # * `shopping_cart`: Predicts items frequently bought together with one or + # more catalog items in the same shopping session. Commonly displayed after + # `add-to-cart` events, on product detail pages, or on the shopping cart + # page. + # + # * `home_page`: Predicts the next product that a user will most likely + # engage with or purchase based on the shopping or viewing history of the + # specified `userId` or `visitorId`. For example - Recommendations for you. + # + # * `product_detail`: Predicts the next product that a user will most likely + # engage with or purchase. The prediction is based on the shopping or + # viewing history of the specified `userId` or `visitorId` and its + # relevance to a specified `CatalogItem`. Typically used on product detail + # pages. For example - More items like this. + # + # * `recently_viewed_default`: Returns up to 75 items recently viewed by the + # specified `userId` or `visitorId`, most recent ones first. Returns + # nothing if neither of them has viewed any items yet. For example - + # Recently viewed. + # + # The full list of available placements can be seen at + # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + # @!attribute [rw] user_event + # @return [::Google::Cloud::RecommendationEngine::V1beta1::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. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return per page. Set this property + # to the number of prediction results required. If zero, the service will + # choose a reasonable default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The previous PredictResponse.next_page_token. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter for restricting prediction results. Accepts values for + # tags and the `filterOutOfStockItems` flag. + # + # * Tag expressions. Restricts predictions to items 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 KiB. + # + # * filterOutOfStockItems. Restricts predictions to items 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 + # @!attribute [rw] dry_run + # @return [::Boolean] + # Optional. Use dryRun mode for this prediction query. If set to true, a + # dummy model will be used that returns arbitrary catalog items. + # Note that the dryRun 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}] + # Optional. Additional domain specific parameters for the predictions. + # + # Allowed values: + # + # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + # object will be returned in the + # `PredictResponse.PredictionResult.itemMetadata` object in the method + # response. + # * `returnItemScore`: Boolean. If set to true, the prediction 'score' + # corresponding to each returned item will be set in the `metadata` + # field in the prediction response. The given 'score' indicates the + # probability of an item being clicked/purchased given the user's context + # and history. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels for the predict request. + # + # * Label keys can contain lowercase letters, digits and hyphens, must start + # with a letter, and must end with a letter or digit. + # * Non-zero label values can contain lowercase letters, digits and hyphens, + # must start with a letter, and must end with a letter or digit. + # * No more than 64 labels can be associated with a given request. + # + # See https://goo.gl/xmQnxf for more information on and examples of labels. + 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::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] + # A list of recommended items. The order represents the ranking (from the + # most relevant item to the least). + # @!attribute [rw] recommendation_token + # @return [::String] + # A unique recommendation token. This should be included in the user event + # logs resulting from this recommendation, which enables accurate attribution + # of recommendation model performance. + # @!attribute [rw] items_missing_in_catalog + # @return [::Array<::String>] + # IDs of items in the request that were missing from the catalog. + # @!attribute [rw] dry_run + # @return [::Boolean] + # True if the dryRun property was set in the request. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional domain specific prediction response metadata. + # @!attribute [rw] next_page_token + # @return [::String] + # If empty, the list is complete. If nonempty, the token to pass to the next + # request's PredictRequest.page_token. + 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 catalog item + # @!attribute [rw] item_metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional item metadata / annotations. + # + # Possible values: + # + # * `catalogItem`: JSON representation of the catalogItem. Will be set if + # `returnCatalogItem` is set to true in `PredictRequest.params`. + # * `score`: Prediction score in double value. Will be set if + # `returnItemScore` 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 ItemMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!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 diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb new file mode 100644 index 000000000000..7f8027593df7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb @@ -0,0 +1,367 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # UserEvent captures all metadata information recommendation engine 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. + # * `add-to-list` Items being added to a list (shopping list, favorites + # etc). + # * `category-page-view` Special pages such as sale or promotion pages + # viewed. + # * `checkout-start` User starting a checkout process. + # * `detail-page-view` Products detail page viewed. + # * `home-page-view` Homepage viewed. + # * `page-visit` Generic page visits not included in the event types above. + # * `purchase-complete` User finishing a purchase. + # * `refund` Purchased items being refunded or returned. + # * `remove-from-cart` Products being removed from cart. + # * `remove-from-list` Items being removed from a list. + # * `search` Product search. + # * `shopping-cart-page-view` User viewing a shopping cart. + # * `impression` List of items displayed. Used by Google Tag Manager. + # @!attribute [rw] user_info + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserInfo] + # Required. User information. + # @!attribute [rw] event_detail + # @return [::Google::Cloud::RecommendationEngine::V1beta1::EventDetail] + # Optional. User event detailed information common across different + # recommendation types. + # @!attribute [rw] product_event_detail + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail] + # Optional. Retail product specific user event metadata. + # + # This field is required for the following event types: + # + # * `add-to-cart` + # * `add-to-list` + # * `category-page-view` + # * `checkout-start` + # * `detail-page-view` + # * `purchase-complete` + # * `refund` + # * `remove-from-cart` + # * `remove-from-list` + # * `search` + # + # This field is optional for the following event types: + # + # * `page-visit` + # * `shopping-cart-page-view` - note that 'product_event_detail' should be + # set for this unless the shopping cart is empty. + # + # This field is not allowed for the following event types: + # + # * `home-page-view` + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Only required for ImportUserEvents method. Timestamp of user + # event created. + # @!attribute [rw] event_source + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource] + # Optional. This field should *not* be set when using JavaScript pixel + # or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + class UserEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # User event source. + module EventSource + # Unspecified event source. + EVENT_SOURCE_UNSPECIFIED = 0 + + # The event is ingested via a javascript pixel or Recommendations AI Tag + # through automl datalayer or JS Macros. + AUTOML = 1 + + # The event is ingested via Recommendations AI Tag through Enhanced + # Ecommerce datalayer. + ECOMMERCE = 2 + + # The event is ingested via Import user events API. + BATCH_UPLOAD = 3 + end + end + + # Information of end users. + # @!attribute [rw] visitor_id + # @return [::String] + # Required. A unique identifier for tracking visitors with a length limit of + # 128 bytes. + # + # For example, this could be implemented with a 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. + # Maximum length 128 bytes. Cannot be empty. + # @!attribute [rw] user_id + # @return [::String] + # Optional. Unique identifier for logged-in user with a length limit of 128 + # bytes. Required only for logged-in users. + # @!attribute [rw] ip_address + # @return [::String] + # Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + # IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + # set when using the javascript pixel or if `direct_user_request` is set. + # Used to extract location information for personalization. + # @!attribute [rw] user_agent + # @return [::String] + # Optional. User agent as included in the HTTP header. UTF-8 encoded string + # with a length limit of 1 KiB. + # + # This should *not* be set when using the JavaScript pixel or if + # `directUserRequest` is set. + # @!attribute [rw] direct_user_request + # @return [::Boolean] + # Optional. Indicates if the request is made directly from the end user + # in which case the user_agent and ip_address fields can be populated + # from the HTTP request. This should *not* be set when using the javascript + # pixel. 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). + class UserInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # User event details shared by all recommendation types. + # @!attribute [rw] uri + # @return [::String] + # Optional. Complete url (window.location.href) of the user's current page. + # When using the JavaScript pixel, this value is filled in automatically. + # Maximum length 5KB. + # @!attribute [rw] referrer_uri + # @return [::String] + # Optional. The referrer url of the current page. When using + # the JavaScript pixel, this value is filled in automatically. + # @!attribute [rw] page_view_id + # @return [::String] + # Optional. 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. This `pageViewId` will be + # automatically generated if using the JavaScript pixel. + # @!attribute [rw] experiment_ids + # @return [::Array<::String>] + # Optional. 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 Recommendation + # Engine system, using different recommendation models). + # @!attribute [rw] recommendation_token + # @return [::String] + # Optional. Recommendation token included in the recommendation prediction + # response. + # + # This field enables accurate attribution of recommendation model + # performance. + # + # This token enables us to accurately attribute page view or purchase back to + # the event and the particular predict response containing this + # clicked/purchased item. If user clicks on product K in the recommendation + # results, pass the `PredictResponse.recommendationToken` property as a url + # parameter to product K's page. When recording events on product K's page, + # log the PredictResponse.recommendation_token to this field. + # + # Optional, but highly encouraged for user events that are the result of a + # recommendation prediction query. + # @!attribute [rw] event_attributes + # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] + # Optional. Extra user event features to include in the recommendation + # model. + # + # For product recommendation, an example of extra user information is + # traffic_channel, i.e. how user arrives at the site. Users can arrive + # at the site by coming to the site directly, or coming through Google + # search, and etc. + class EventDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ProductEventDetail captures user event information specific to retail + # products. + # @!attribute [rw] search_query + # @return [::String] + # Required for `search` events. Other event types should not set this field. + # The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + # @!attribute [rw] page_categories + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem::CategoryHierarchy>] + # Required for `category-page-view` events. Other event types should not set + # this field. + # The categories associated with a category page. + # Category pages include special pages such as sales or promotions. For + # instance, a special sale page may have the category hierarchy: + # categories : ["Sales", "2017 Black Friday Deals"]. + # @!attribute [rw] product_details + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::ProductDetail>] + # The main product details related to the event. + # + # This field is required for the following event types: + # + # * `add-to-cart` + # * `add-to-list` + # * `checkout-start` + # * `detail-page-view` + # * `purchase-complete` + # * `refund` + # * `remove-from-cart` + # * `remove-from-list` + # + # This field is optional for the following event types: + # + # * `page-visit` + # * `shopping-cart-page-view` - note that 'product_details' should be set for + # this unless the shopping cart is empty. + # + # This field is not allowed for the following event types: + # + # * `category-page-view` + # * `home-page-view` + # * `search` + # @!attribute [rw] list_id + # @return [::String] + # Required for `add-to-list` and `remove-from-list` events. The id or name of + # the list that the item is being added to or removed from. Other event types + # should not set this field. + # @!attribute [rw] cart_id + # @return [::String] + # Optional. 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`, `remove-from-cart`, + # `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + # @!attribute [rw] purchase_transaction + # @return [::Google::Cloud::RecommendationEngine::V1beta1::PurchaseTransaction] + # Optional. A transaction represents the entire purchase transaction. + # Required for `purchase-complete` events. Optional for `checkout-start` + # events. Other event types should not set this field. + class ProductEventDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transaction represents the entire purchase transaction. + # @!attribute [rw] id + # @return [::String] + # Optional. The transaction ID with a length limit of 128 bytes. + # @!attribute [rw] revenue + # @return [::Float] + # Required. Total 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. This field + # is not required if the event type is `refund`. + # @!attribute [rw] taxes + # @return [::Google::Protobuf::Map{::String => ::Float}] + # Optional. All the taxes associated with the transaction. + # @!attribute [rw] costs + # @return [::Google::Protobuf::Map{::String => ::Float}] + # Optional. All the costs associated with the product. These can be + # manufacturing costs, shipping expenses not borne by the end user, or any + # other costs. + # + # Total product cost such that + # profit = revenue - (sum(taxes) + sum(costs)) + # If product_cost is not set, then + # profit = revenue - tax - shipping - sum(CatalogItem.costs). + # + # If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + # based profit *cannot* be calculated for this Transaction. + # @!attribute [rw] currency_code + # @return [::String] + # Required. Currency code. Use three-character ISO-4217 code. This field + # is not required if the event type is `refund`. + class PurchaseTransaction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class TaxesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class CostsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Detailed product information associated with a user event. + # @!attribute [rw] id + # @return [::String] + # Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + # characters. + # @!attribute [rw] currency_code + # @return [::String] + # Optional. Currency code for price/costs. Use three-character ISO-4217 + # code. Required only if originalPrice or displayPrice is set. + # @!attribute [rw] original_price + # @return [::Float] + # Optional. Original price of the product. If provided, this will override + # the original price in Catalog for this product. + # @!attribute [rw] display_price + # @return [::Float] + # Optional. Display price of the product (e.g. discounted price). If + # provided, this will override the display price in Catalog for this product. + # @!attribute [rw] stock_state + # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState] + # Optional. Item stock state. If provided, this overrides the stock state + # in Catalog for items in this event. + # @!attribute [rw] quantity + # @return [::Integer] + # Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + # `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + # types. + # @!attribute [rw] available_quantity + # @return [::Integer] + # Optional. Quantity of the products in stock when a user event happens. + # Optional. If provided, this overrides the available quantity in Catalog for + # this event. and can only be set if `stock_status` is set to `IN_STOCK`. + # + # Note that if an item is out of stock, you must set the `stock_state` field + # to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + # sufficient to mark the item out of stock. + # @!attribute [rw] item_attributes + # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] + # Optional. Extra features associated with a product in the user event. + class ProductDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb new file mode 100644 index 000000000000..4d90fede9bc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module RecommendationEngine + module V1beta1 + # Request message for PurgeUserEvents method. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the event_store under which the events are + # created. The format is + # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string to specify the events to be deleted. Empty + # string filter is not allowed. This filter can also be used with + # ListUserEvents API to list events that will be deleted. The eligible fields + # for filtering are: + # * eventType - UserEvent.eventType field of type string. + # * eventTime - in ISO 8601 "zulu" format. + # * visitorId - field of type string. Specifying this will delete all events + # associated with a visitor. + # * userId - field of type string. Specifying this will delete all events + # associated with a user. + # Example 1: Deleting all events in a time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + # "2012-04-23T18:30:43.511Z"` + # Example 2: Deleting specific eventType in time range. + # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + # Example 3: Deleting all events for a specific visitor + # `visitorId = visitor1024` + # The filtering fields are assumed to have an implicit AND. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. The default value is false. Override this flag to true to + # actually perform the purge. If the field is not set to true, a sampling of + # events to be deleted will be returned. + class PurgeUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeUserEvents operation. + # This will be returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] operation_name + # @return [::String] + # The ID of the request / operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + class PurgeUserEventsMetadata + 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. + # @!attribute [rw] user_events_sample + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # A sampling of events deleted (or will be deleted) depending on the `force` + # property in the request. Max of 500 items will be returned. + class PurgeUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for WriteUserEvent method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent eventStore resource name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @!attribute [rw] user_event + # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] + # Required. User event to write. + class WriteUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CollectUserEvent method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent eventStore name, such as + # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + # @!attribute [rw] user_event + # @return [::String] + # Required. URL encoded UserEvent proto. + # @!attribute [rw] uri + # @return [::String] + # Optional. The url including cgi-parameters but excluding the hash fragment. + # The URL must be truncated to 1.5K bytes to conservatively be under the 2K + # bytes. 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] + # Optional. The event timestamp in milliseconds. This prevents browser + # caching of otherwise identical get requests. The name is abbreviated to + # reduce the payload bytes. + class CollectUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListUserEvents method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent eventStore resource name, such as + # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return per page. If zero, the + # service will choose a reasonable default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The previous ListUserEventsResponse.next_page_token. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering expression to specify restrictions over + # returned events. This is a sequence of terms, where each term applies some + # kind of a restriction to the returned user events. Use this expression to + # restrict results to a specific time range, or filter events by eventType. + # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + # eventTime<"2012-04-23T18:25:43.511Z" eventType=search + # + # We expect only 3 types of fields: + # + # * eventTime: this can be specified a maximum of 2 times, once with a + # less than operator and once with a greater than operator. The + # eventTime restrict should result in one contiguous valid eventTime + # range. + # + # * eventType: only 1 eventType restriction can be specified. + # + # * eventsMissingCatalogItems: specififying this will restrict results + # to events for which catalog items were not found in the catalog. The + # default behavior is to return only those events for which catalog + # items were found. + # + # Some examples of valid filters expressions: + # + # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" + # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + # eventType = detail-page-view + # * Example 3: eventsMissingCatalogItems + # eventType = search eventTime < "2018-04-23T18:30:43.511Z" + # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + # * Example 5: eventType = search + # * Example 6: eventsMissingCatalogItems + class ListUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListUserEvents method. + # @!attribute [rw] user_events + # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] + # The user events. + # @!attribute [rw] next_page_token + # @return [::String] + # If empty, the list is complete. If nonempty, the token to pass to the next + # request's ListUserEvents.page_token. + class ListUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..6c9d6704e9f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1", path: "../" +else + gem "google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb new file mode 100644 index 000000000000..46494eab013d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the create_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item. +# +def create_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new + + # Call the create_catalog_item method. + result = client.create_catalog_item request + + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end +# [END recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb new file mode 100644 index 000000000000..775ced7d5951 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the delete_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item. +# +def delete_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new + + # Call the delete_catalog_item method. + result = client.delete_catalog_item request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb new file mode 100644 index 000000000000..98f413ad6392 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the get_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item. +# +def get_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new + + # Call the get_catalog_item method. + result = client.get_catalog_item request + + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end +# [END recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb new file mode 100644 index 000000000000..4ba07a7b81e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.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 recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the import_catalog_items 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::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items. +# +def import_catalog_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new + + # Call the import_catalog_items method. + result = client.import_catalog_items request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb new file mode 100644 index 000000000000..bf9bdcc0bb46 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.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 recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the list_catalog_items 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::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items. +# +def list_catalog_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new + + # Call the list_catalog_items method. + result = client.list_catalog_items request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p item + end +end +# [END recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb new file mode 100644 index 000000000000..e23bd345d17c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the update_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item. +# +def update_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new + + # Call the update_catalog_item method. + result = client.update_catalog_item request + + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end +# [END recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb new file mode 100644 index 000000000000..0570218a7357 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the create_prediction_api_key_registration call in the PredictionApiKeyRegistry service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration. +# +def create_prediction_api_key_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new + + # Call the create_prediction_api_key_registration method. + result = client.create_prediction_api_key_registration request + + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + p result +end +# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb new file mode 100644 index 000000000000..3c5a1e2c1ca6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the delete_prediction_api_key_registration call in the PredictionApiKeyRegistry service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration. +# +def delete_prediction_api_key_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new + + # Call the delete_prediction_api_key_registration method. + result = client.delete_prediction_api_key_registration request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb new file mode 100644 index 000000000000..51c83a42921d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.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 recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the list_prediction_api_key_registrations call in the PredictionApiKeyRegistry service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations. +# +def list_prediction_api_key_registrations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new + + # Call the list_prediction_api_key_registrations method. + result = client.list_prediction_api_key_registrations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + p item + end +end +# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb new file mode 100644 index 000000000000..d06c9e4b0867 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.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 recommendationengine_v1beta1_generated_PredictionService_Predict_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# 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::RecommendationEngine::V1beta1::PredictionService::Client#predict. +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new + + # Call the predict method. + result = client.predict request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. + p item + end +end +# [END recommendationengine_v1beta1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json new file mode 100644 index 000000000000..a7aeab826dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json @@ -0,0 +1,615 @@ +{ + "client_library": { + "name": "google-cloud-recommendation_engine-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.recommendationengine.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync", + "title": "Snippet for the create_catalog_item call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item.", + "file": "catalog_service/create_catalog_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_catalog_item", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "CreateCatalogItem", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.CreateCatalogItem", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync", + "title": "Snippet for the get_catalog_item call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item.", + "file": "catalog_service/get_catalog_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_catalog_item", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "GetCatalogItem", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.GetCatalogItem", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync", + "title": "Snippet for the list_catalog_items call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items.", + "file": "catalog_service/list_catalog_items.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_catalog_items", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "ListCatalogItems", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.ListCatalogItems", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync", + "title": "Snippet for the update_catalog_item call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item.", + "file": "catalog_service/update_catalog_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_catalog_item", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "UpdateCatalogItem", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.UpdateCatalogItem", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync", + "title": "Snippet for the delete_catalog_item call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item.", + "file": "catalog_service/delete_catalog_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_catalog_item", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "DeleteCatalogItem", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.DeleteCatalogItem", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync", + "title": "Snippet for the import_catalog_items call in the CatalogService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items.", + "file": "catalog_service/import_catalog_items.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_catalog_items", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CatalogService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" + }, + "method": { + "short_name": "ImportCatalogItems", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.ImportCatalogItems", + "service": { + "short_name": "CatalogService", + "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync", + "title": "Snippet for the create_prediction_api_key_registration call in the PredictionApiKeyRegistry service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration.", + "file": "prediction_api_key_registry/create_prediction_api_key_registration.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_prediction_api_key_registration", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration", + "client": { + "short_name": "PredictionApiKeyRegistry::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" + }, + "method": { + "short_name": "CreatePredictionApiKeyRegistration", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.CreatePredictionApiKeyRegistration", + "service": { + "short_name": "PredictionApiKeyRegistry", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync", + "title": "Snippet for the list_prediction_api_key_registrations call in the PredictionApiKeyRegistry service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations.", + "file": "prediction_api_key_registry/list_prediction_api_key_registrations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_prediction_api_key_registrations", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse", + "client": { + "short_name": "PredictionApiKeyRegistry::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" + }, + "method": { + "short_name": "ListPredictionApiKeyRegistrations", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.ListPredictionApiKeyRegistrations", + "service": { + "short_name": "PredictionApiKeyRegistry", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync", + "title": "Snippet for the delete_prediction_api_key_registration call in the PredictionApiKeyRegistry service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration.", + "file": "prediction_api_key_registry/delete_prediction_api_key_registration.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_prediction_api_key_registration", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "PredictionApiKeyRegistry::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" + }, + "method": { + "short_name": "DeletePredictionApiKeyRegistration", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.DeletePredictionApiKeyRegistration", + "service": { + "short_name": "PredictionApiKeyRegistry", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::PredictionService::Client#predict.", + "file": "prediction_service/predict.rb", + "language": "RUBY", + "client_method": { + "short_name": "predict", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client#predict", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse", + "client": { + "short_name": "PredictionService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client" + }, + "method": { + "short_name": "Predict", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionService.Predict", + "service": { + "short_name": "PredictionService", + "full_name": "google.cloud.recommendationengine.v1beta1.PredictionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#write_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::UserEvent", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" + }, + "method": { + "short_name": "WriteUserEvent", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.WriteUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#collect_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::HttpBody", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" + }, + "method": { + "short_name": "CollectUserEvent", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.CollectUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync", + "title": "Snippet for the list_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events.", + "file": "user_event_service/list_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_user_events", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" + }, + "method": { + "short_name": "ListUserEvents", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.ListUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#purge_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" + }, + "method": { + "short_name": "PurgeUserEvents", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.PurgeUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#import_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" + }, + "method": { + "short_name": "ImportUserEvents", + "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.ImportUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.recommendationengine.v1beta1.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-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb new file mode 100644 index 000000000000..8d96f262e4f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# 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::RecommendationEngine::V1beta1::UserEventService::Client#collect_user_event. +# +def collect_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb new file mode 100644 index 000000000000..8a715d8c7c62 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# 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::RecommendationEngine::V1beta1::UserEventService::Client#import_user_events. +# +def import_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb new file mode 100644 index 000000000000..4a9a2321fab9 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.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 recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# Snippet for the list_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::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events. +# +def list_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new + + # Call the list_user_events method. + result = client.list_user_events request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + p item + end +end +# [END recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb new file mode 100644 index 000000000000..e83fe2837090 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# 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::RecommendationEngine::V1beta1::UserEventService::Client#purge_user_events. +# +def purge_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb new file mode 100644 index 000000000000..2bb4971f10ec --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] +require "google/cloud/recommendation_engine/v1beta1" + +## +# 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::RecommendationEngine::V1beta1::UserEventService::Client#write_user_event. +# +def write_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new + + # Call the write_user_event method. + result = client.write_user_event request + + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + p result +end +# [END recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb new file mode 100644 index 000000000000..25c721d36010 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendationengine/v1beta1/catalog_service_pb" +require "google/cloud/recommendationengine/v1beta1/catalog_service_services_pb" +require "google/cloud/recommendation_engine/v1beta1/catalog_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb new file mode 100644 index 000000000000..41e5cdc109a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/catalog_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::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_catalog_item_path_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.catalog_item_path_path project: "value0", location: "value1", catalog: "value2", catalog_item_path: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/catalogItems/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb new file mode 100644 index 000000000000..ea8c64d25a13 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb @@ -0,0 +1,432 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/recommendationengine/v1beta1/catalog_service_pb" +require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" + + +class ::Google::Cloud::RecommendationEngine::V1beta1::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_create_catalog_item + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + catalog_item = {} + + create_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_create_catalog_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_catalog_item({ parent: parent, catalog_item: catalog_item }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_catalog_item parent: parent, catalog_item: catalog_item do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_catalog_item({ parent: parent, catalog_item: catalog_item }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_catalog_item_client_stub.call_count + end + end + end + + def test_get_catalog_item + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_get_catalog_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_catalog_item({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_catalog_item name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_catalog_item({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_catalog_item_client_stub.call_count + end + end + end + + def test_list_catalog_items + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.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_catalog_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_list_catalog_items_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_catalog_items_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_catalog_items({ 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_catalog_items 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items({ 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items_client_stub.call_count + end + end + end + + def test_update_catalog_item + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + catalog_item = {} + update_mask = {} + + update_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_update_catalog_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_catalog_item({ name: name, catalog_item: catalog_item, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_catalog_item name: name, catalog_item: catalog_item, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_catalog_item({ name: name, catalog_item: catalog_item, 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_item(::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item_client_stub.call_count + end + end + end + + def test_delete_catalog_item + # 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_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_delete_catalog_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_catalog_item({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_catalog_item name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_catalog_item({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_catalog_item_client_stub.call_count + end + end + end + + def test_import_catalog_items + # Create test objects. + 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 = {} + + import_catalog_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_import_catalog_items_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_catalog_items_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_catalog_items({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_catalog_items parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb new file mode 100644 index 000000000000..635d3a216a6f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb @@ -0,0 +1,494 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" +require "google/cloud/recommendation_engine/v1beta1/catalog_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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_create_catalog_item + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + catalog_item = {} + + create_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_catalog_item, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem), request["catalog_item"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_catalog_item({ parent: parent, catalog_item: catalog_item }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_catalog_item parent: parent, catalog_item: catalog_item do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_catalog_item({ parent: parent, catalog_item: catalog_item }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_catalog_item_client_stub.call_rpc_count + end + end + + def test_get_catalog_item + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_catalog_item, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_catalog_item({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_catalog_item name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_catalog_item({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_catalog_item_client_stub.call_rpc_count + end + end + + def test_list_catalog_items + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_catalog_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_catalog_items, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, 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_catalog_items_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_catalog_items({ 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_catalog_items 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items({ 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items_client_stub.call_rpc_count + end + end + + def test_update_catalog_item + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + catalog_item = {} + update_mask = {} + + update_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_catalog_item, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem), request["catalog_item"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_catalog_item({ name: name, catalog_item: catalog_item, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_catalog_item name: name, catalog_item: catalog_item, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item({ name: name, catalog_item: catalog_item, 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_item(::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item_client_stub.call_rpc_count + end + end + + def test_delete_catalog_item + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_catalog_item, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_catalog_item_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_catalog_item({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_catalog_item name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_catalog_item({ 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_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(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_catalog_item_client_stub.call_rpc_count + end + end + + def test_import_catalog_items + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = {} + + import_catalog_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_catalog_items, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::InputConfig), request["input_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig), request["errors_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_catalog_items_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items parent: parent, request_id: request_id, 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb new file mode 100644 index 000000000000..21186300ee96 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_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/recommendation_engine/v1beta1/prediction_api_key_registry" + +class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_event_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_store_path project: "value0", location: "value1", catalog: "value2", event_store: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3", path + end + end + + def test_prediction_api_key_registration_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.prediction_api_key_registration_path project: "value0", location: "value1", catalog: "value2", event_store: "value3", prediction_api_key_registration: "value4" + assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3/predictionApiKeyRegistrations/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb new file mode 100644 index 000000000000..d39ddce351c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.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! + +require "helper" +require "gapic/rest" +require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" + + +class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + prediction_api_key_registration = {} + + create_prediction_api_key_registration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_create_prediction_api_key_registration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_prediction_api_key_registration_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_prediction_api_key_registration parent: parent, prediction_api_key_registration: prediction_api_key_registration do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_prediction_api_key_registration_client_stub.call_count + end + end + end + + def test_list_prediction_api_key_registrations + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.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_prediction_api_key_registrations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_list_prediction_api_key_registrations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_prediction_api_key_registrations_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_prediction_api_key_registrations({ 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_prediction_api_key_registrations 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_prediction_api_key_registrations ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations({ 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_prediction_api_key_registrations(::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations_client_stub.call_count + end + end + end + + def test_delete_prediction_api_key_registration + # 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_prediction_api_key_registration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_delete_prediction_api_key_registration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_prediction_api_key_registration_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_prediction_api_key_registration({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_prediction_api_key_registration name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_prediction_api_key_registration({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_prediction_api_key_registration_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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb new file mode 100644 index 000000000000..abc7cdd78800 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb @@ -0,0 +1,289 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" + +class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + prediction_api_key_registration = {} + + create_prediction_api_key_registration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_prediction_api_key_registration, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration), request["prediction_api_key_registration"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_prediction_api_key_registration_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_prediction_api_key_registration parent: parent, prediction_api_key_registration: prediction_api_key_registration do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_prediction_api_key_registration_client_stub.call_rpc_count + end + end + + def test_list_prediction_api_key_registrations + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_prediction_api_key_registrations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_prediction_api_key_registrations, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, 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_prediction_api_key_registrations_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_prediction_api_key_registrations({ parent: parent, page_size: page_size, page_token: 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_prediction_api_key_registrations parent: parent, page_size: page_size, page_token: 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_prediction_api_key_registrations ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations({ 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_prediction_api_key_registrations(::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations_client_stub.call_rpc_count + end + end + + def test_delete_prediction_api_key_registration + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_prediction_api_key_registration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_prediction_api_key_registration, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_prediction_api_key_registration_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_prediction_api_key_registration({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_prediction_api_key_registration name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_prediction_api_key_registration({ 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_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(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_prediction_api_key_registration_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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb new file mode 100644 index 000000000000..be6c20ea43d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/prediction_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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_placement_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.placement_path project: "value0", location: "value1", catalog: "value2", event_store: "value3", placement: "value4" + assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3/placements/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb new file mode 100644 index 000000000000..16b9e82a5a80 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/prediction_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" + + +class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + user_event = {} + page_size = 42 + page_token = "hello world" + filter = "hello world" + dry_run = 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::RecommendationEngine::V1beta1::PredictionService::Rest::ServiceStub.stub :transcode_predict_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, predict_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.predict name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.predict ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, 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::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb new file mode 100644 index 000000000000..7455360d0c7d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" +require "google/cloud/recommendation_engine/v1beta1/prediction_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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. + name = "hello world" + user_event = {} + page_size = 42 + page_token = "hello world" + filter = "hello world" + dry_run = 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::RecommendationEngine::V1beta1::PredictRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::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["dry_run"] + 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::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.predict name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.predict ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.predict(::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb new file mode 100644 index 000000000000..e3226a5ba887 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/user_event_service_pb" +require "google/cloud/recommendationengine/v1beta1/user_event_service_services_pb" +require "google/cloud/recommendation_engine/v1beta1/user_event_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb new file mode 100644 index 000000000000..2bebd9ae77b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_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/recommendation_engine/v1beta1/user_event_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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_event_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_store_path project: "value0", location: "value1", catalog: "value2", event_store: "value3" + assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb new file mode 100644 index 000000000000..1e04762a5677 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/user_event_service_pb" +require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" + + +class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.write_user_event parent: parent, user_event: user_event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event) 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 }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.write_user_event(::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event), 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. + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + + 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.collect_user_event(::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), 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_list_user_events + # Create test objects. + client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.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_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::RecommendationEngine::V1beta1::UserEventService::Rest::ServiceStub.stub :transcode_list_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_user_events_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_user_events({ 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_user_events 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_user_events ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events({ 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_user_events(::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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" + request_id = "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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_user_events({ parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb new file mode 100644 index 000000000000..3bb097a3c25c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" +require "google/cloud/recommendation_engine/v1beta1/user_event_service" + +class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::WriteUserEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent), request["user_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, write_user_event_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event }) 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 do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event) 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 }, 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::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event), 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. + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + + 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::RecommendationEngine::V1beta1::CollectUserEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["user_event"] + assert_equal "hello world", request["uri"] + assert_equal 42, request["ets"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, collect_user_event_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, 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::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), 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_list_user_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_user_events, name + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, 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_user_events_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_user_events({ 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_user_events 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_user_events ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events({ 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_user_events(::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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" + request_id = "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::RecommendationEngine::V1beta1::ImportUserEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::InputConfig), request["input_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig), request["errors_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_user_events_client_stub do + # Create client + client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_user_events({ parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine/.gitignore b/owl-bot-staging/google-cloud-recommendation_engine/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/.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-recommendation_engine/.repo-metadata.json b/owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json new file mode 100644 index 000000000000..b39e1c10e46c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recommendationengine.googleapis.com", + "api_shortname": "recommendationengine", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine/latest", + "distribution_name": "google-cloud-recommendation_engine", + "is_cloud": true, + "language": "ruby", + "name": "recommendationengine", + "name_pretty": "Recommendations AI API", + "product_documentation": "https://cloud.google.com/recommendations", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Recommendations AI 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": "RECOMMENDATION_ENGINE", + "ruby-cloud-product-url": "https://cloud.google.com/recommendations", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml b/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml new file mode 100644 index 000000000000..c4f711187121 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recommendation_engine.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-recommendation_engine.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recommendation_engine/.toys.rb b/owl-bot-staging/google-cloud-recommendation_engine/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/.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-recommendation_engine/.yardopts b/owl-bot-staging/google-cloud-recommendation_engine/.yardopts new file mode 100644 index 000000000000..31cc53ded05b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Recommendations AI 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-recommendation_engine/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md new file mode 100644 index 000000000000..c225dd7f867a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recommendation_engine 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-recommendation_engine 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/recommendation_engine" + +client = Google::Cloud::RecommendationEngine.catalog_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recommendation_engine" + +Google::Cloud::RecommendationEngine.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::RecommendationEngine.catalog_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-recommendation_engine +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/recommendation_engine" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::RecommendationEngine.catalog_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-recommendation_engine/CHANGELOG.md b/owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recommendation_engine/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine/Gemfile new file mode 100644 index 000000000000..c5273e254504 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-recommendation_engine-v1beta1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recommendation_engine.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-recommendation_engine/LICENSE.md b/owl-bot-staging/google-cloud-recommendation_engine/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/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-recommendation_engine/README.md b/owl-bot-staging/google-cloud-recommendation_engine/README.md new file mode 100644 index 000000000000..e8663089ba0a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Recommendations AI API + +API Client library for the Recommendations AI API + +Recommendations AI 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-recommendation_engine-v*`. +The gem `google-cloud-recommendation_engine` 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-recommendation_engine/latest) +for this library, google-cloud-recommendation_engine, 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-recommendation_engine-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest). + +See also the [Product Documentation](https://cloud.google.com/recommendations) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-recommendation_engine +``` + +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/recommendationengine.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/recommendation_engine" + +client = Google::Cloud::RecommendationEngine.catalog_service +request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new # (request fields as keyword arguments...) +response = client.create_catalog_item 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-recommendation_engine-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-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-recommendation_engine`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recommendation_engine-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-recommendation_engine`. +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-recommendation_engine-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-recommendation_engine/Rakefile b/owl-bot-staging/google-cloud-recommendation_engine/Rakefile new file mode 100644 index 000000000000..3a827aff4b13 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/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-recommendation_engine acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECOMMENDATION_ENGINE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECOMMENDATION_ENGINE_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 RECOMMENDATION_ENGINE_TEST_PROJECT=test123 RECOMMENDATION_ENGINE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" + ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECOMMENDATION_ENGINE_PROJECT"] = project + ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] = project + ENV["RECOMMENDATION_ENGINE_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-recommendation_engine 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-recommendation_engine 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-recommendation_engine 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-recommendation_engine gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recommendation_engine" + header "google-cloud-recommendation_engine rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recommendation_engine yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recommendation_engine 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-recommendation_engine 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-recommendation_engine 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-recommendation_engine/google-cloud-recommendation_engine.gemspec b/owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec new file mode 100644 index 000000000000..dbf29f4e22ff --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recommendation_engine/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recommendation_engine" + gem.version = Google::Cloud::RecommendationEngine::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Recommendations AI 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 Recommendations AI 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-recommendation_engine-v1beta1", ">= 0.8", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb new file mode 100644 index 000000000000..afc81d0994a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.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/recommendation_engine" unless defined? Google::Cloud::RecommendationEngine::VERSION diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb new file mode 100644 index 000000000000..51f6a2acf3ef --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb @@ -0,0 +1,370 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/recommendation_engine/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! :recommendation_engine 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 RecommendationEngine + ## + # Create a new client object for CatalogService. + # + # By default, this returns an instance of + # [Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-CatalogService-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 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::RecommendationEngine.catalog_service_available?}. + # + # ## About CatalogService + # + # Service for ingesting catalog information of the customer's website. + # + # @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.catalog_service version: :v1beta1, transport: :grpc, &block + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.catalog_service_available? version: :v1beta1, transport: :grpc + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RecommendationEngine.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 PredictionApiKeyRegistry. + # + # By default, this returns an instance of + # [Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-PredictionApiKeyRegistry-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 PredictionApiKeyRegistry 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 PredictionApiKeyRegistry service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::RecommendationEngine.prediction_api_key_registry_available?}. + # + # ## About PredictionApiKeyRegistry + # + # Service for registering API keys for use with the `predict` method. If you + # use an API key to request predictions, you must first register the API key. + # Otherwise, your prediction request is rejected. If you use OAuth to + # authenticate your `predict` method call, you do not need to register an API + # key. You can register up to 20 API keys per project. + # + # @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.prediction_api_key_registry version: :v1beta1, transport: :grpc, &block + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RecommendationEngine.const_get(package_name).const_get(:PredictionApiKeyRegistry) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PredictionApiKeyRegistry service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.prediction_api_key_registry}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PredictionApiKeyRegistry service, + # or if the versioned client gem needs an update to support the PredictionApiKeyRegistry 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.prediction_api_key_registry_available? version: :v1beta1, transport: :grpc + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RecommendationEngine.const_get package_name + return false unless service_module.const_defined? :PredictionApiKeyRegistry + service_module = service_module.const_get :PredictionApiKeyRegistry + 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::RecommendationEngine::V1beta1::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-PredictionService-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 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::RecommendationEngine.prediction_service_available?}. + # + # ## About PredictionService + # + # Service for making recommendation prediction. + # + # @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.prediction_service version: :v1beta1, transport: :grpc, &block + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.prediction_service_available? version: :v1beta1, transport: :grpc + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RecommendationEngine.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 UserEventService. + # + # By default, this returns an instance of + # [Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserEventService-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 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::RecommendationEngine.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 `:v1beta1`. + # @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: :v1beta1, transport: :grpc, &block + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. + # @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: :v1beta1, transport: :grpc + require "google/cloud/recommendation_engine/#{version.to_s.downcase}" + package_name = Google::Cloud::RecommendationEngine + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::RecommendationEngine.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-recommendation_engine 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.recommendation_engine if block_given? + + ::Google::Cloud.configure.recommendation_engine + end + end + end +end + +helper_path = ::File.join __dir__, "recommendation_engine", "helpers.rb" +require "google/cloud/recommendation_engine/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb new file mode 100644 index 000000000000..ab6d2e72fa21 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/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 RecommendationEngine + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb new file mode 100644 index 000000000000..f582f7064a11 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.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! + +require "helper" +require "google/cloud/recommendation_engine" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::RecommendationEngine::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_catalog_service_grpc + skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.catalog_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client, client + end + end + + def test_catalog_service_rest + skip unless Google::Cloud::RecommendationEngine.catalog_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::RecommendationEngine.catalog_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client, client + end + end + + def test_prediction_api_key_registry_grpc + skip unless Google::Cloud::RecommendationEngine.prediction_api_key_registry_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::RecommendationEngine.prediction_api_key_registry transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client, client + end + end + + def test_prediction_api_key_registry_rest + skip unless Google::Cloud::RecommendationEngine.prediction_api_key_registry_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::RecommendationEngine.prediction_api_key_registry transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client, client + end + end + + def test_prediction_service_grpc + skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.prediction_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client, client + end + end + + def test_prediction_service_rest + skip unless Google::Cloud::RecommendationEngine.prediction_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::RecommendationEngine.prediction_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client, client + end + end + + def test_user_event_service_grpc + skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.user_event_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client, client + end + end + + def test_user_event_service_rest + skip unless Google::Cloud::RecommendationEngine.user_event_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::RecommendationEngine.user_event_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb new file mode 100644 index 000000000000..fd4e833d1a0e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/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/recommendation_engine/version" + +class Google::Cloud::RecommendationEngine::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::RecommendationEngine::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommendation_engine/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-recommender-v1/.gitignore b/owl-bot-staging/google-cloud-recommender-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json new file mode 100644 index 000000000000..b633aec09688 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recommender.googleapis.com", + "api_shortname": "recommender", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest", + "distribution_name": "google-cloud-recommender-v1", + "is_cloud": true, + "language": "ruby", + "name": "recommender", + "name_pretty": "Recommender V1 API", + "product_documentation": "https://cloud.google.com/recommender", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. Note that google-cloud-recommender-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommender instead. See the readme for more details.", + "ruby-cloud-env-prefix": "RECOMMENDER", + "ruby-cloud-product-url": "https://cloud.google.com/recommender", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml b/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml new file mode 100644 index 000000000000..5cc4c15130f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recommender-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-recommender-v1.rb" diff --git a/owl-bot-staging/google-cloud-recommender-v1/.toys.rb b/owl-bot-staging/google-cloud-recommender-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/.yardopts b/owl-bot-staging/google-cloud-recommender-v1/.yardopts new file mode 100644 index 000000000000..e1a499600bf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Recommender 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-recommender-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..c576052b3638 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recommender-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-recommender-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/recommender/v1" + +client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recommender/v1" + +::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender-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/recommender/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recommender-v1/Gemfile b/owl-bot-staging/google-cloud-recommender-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/LICENSE.md b/owl-bot-staging/google-cloud-recommender-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/README.md b/owl-bot-staging/google-cloud-recommender-v1/README.md new file mode 100644 index 000000000000..6bce3518215e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Recommender V1 API + +API Client library for the Recommender V1 API + +Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Recommender V1 API. Most users should consider using +the main client gem, +[google-cloud-recommender](https://rubygems.org/gems/google-cloud-recommender). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-recommender-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/recommender.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/recommender/v1" + +client = ::Google::Cloud::Recommender::V1::Recommender::Client.new +request = ::Google::Cloud::Recommender::V1::ListInsightsRequest.new # (request fields as keyword arguments...) +response = client.list_insights request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/recommender) +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/recommender/v1" +require "logger" + +client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recommender-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-recommender`. +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-recommender-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-recommender-v1/Rakefile b/owl-bot-staging/google-cloud-recommender-v1/Rakefile new file mode 100644 index 000000000000..6f1c5d05dde0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECOMMENDER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECOMMENDER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECOMMENDER_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 RECOMMENDER_TEST_PROJECT=test123 RECOMMENDER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recommender/v1/recommender/credentials" + ::Google::Cloud::Recommender::V1::Recommender::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECOMMENDER_PROJECT"] = project + ENV["RECOMMENDER_TEST_PROJECT"] = project + ENV["RECOMMENDER_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-recommender-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-recommender-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-recommender-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-recommender-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recommender-v1" + header "google-cloud-recommender-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recommender-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recommender-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-recommender-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-recommender-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-recommender-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json new file mode 100644 index 000000000000..a6118686e3b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.recommender.v1", + "libraryPackage": "::Google::Cloud::Recommender::V1", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Recommender::V1::Recommender::Client", + "rpcs": { + "ListInsights": { + "methods": [ + "list_insights" + ] + }, + "GetInsight": { + "methods": [ + "get_insight" + ] + }, + "MarkInsightAccepted": { + "methods": [ + "mark_insight_accepted" + ] + }, + "ListRecommendations": { + "methods": [ + "list_recommendations" + ] + }, + "GetRecommendation": { + "methods": [ + "get_recommendation" + ] + }, + "MarkRecommendationDismissed": { + "methods": [ + "mark_recommendation_dismissed" + ] + }, + "MarkRecommendationClaimed": { + "methods": [ + "mark_recommendation_claimed" + ] + }, + "MarkRecommendationSucceeded": { + "methods": [ + "mark_recommendation_succeeded" + ] + }, + "MarkRecommendationFailed": { + "methods": [ + "mark_recommendation_failed" + ] + }, + "GetRecommenderConfig": { + "methods": [ + "get_recommender_config" + ] + }, + "UpdateRecommenderConfig": { + "methods": [ + "update_recommender_config" + ] + }, + "GetInsightTypeConfig": { + "methods": [ + "get_insight_type_config" + ] + }, + "UpdateInsightTypeConfig": { + "methods": [ + "update_insight_type_config" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec b/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec new file mode 100644 index 000000000000..f6f8fbe70274 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recommender/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recommender-v1" + gem.version = Google::Cloud::Recommender::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. Note that google-cloud-recommender-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommender instead. See the readme for more details." + gem.summary = "API Client library for the Recommender V1 API" + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.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-recommender-v1/lib/google-cloud-recommender-v1.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-v1.rb new file mode 100644 index 000000000000..f0d383ec4232 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-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/recommender/v1" diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb new file mode 100644 index 000000000000..bb42d7731629 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/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/recommender/v1/recommender" +require "google/cloud/recommender/v1/version" + +module Google + module Cloud + module Recommender + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/recommender/v1" + # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/recommender/v1" + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/recommender/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb new file mode 100644 index 000000000000..81fbb3b3202e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommender/v1/insight.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/recommender/v1/insight.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\t\n\x07Insight\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x18\n\x10target_resources\x18\t \x03(\t\x12\x17\n\x0finsight_subtype\x18\n \x01(\t\x12(\n\x07\x63ontent\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x35\n\x11last_refresh_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x12observation_period\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x41\n\nstate_info\x18\x06 \x01(\x0b\x32-.google.cloud.recommender.v1.InsightStateInfo\x12?\n\x08\x63\x61tegory\x18\x07 \x01(\x0e\x32-.google.cloud.recommender.v1.Insight.Category\x12?\n\x08severity\x18\x0f \x01(\x0e\x32-.google.cloud.recommender.v1.Insight.Severity\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12`\n\x1a\x61ssociated_recommendations\x18\x08 \x03(\x0b\x32<.google.cloud.recommender.v1.Insight.RecommendationReference\x1a\x31\n\x17RecommendationReference\x12\x16\n\x0erecommendation\x18\x01 \x01(\t\"\x85\x01\n\x08\x43\x61tegory\x12\x18\n\x14\x43\x41TEGORY_UNSPECIFIED\x10\x00\x12\x08\n\x04\x43OST\x10\x01\x12\x0c\n\x08SECURITY\x10\x02\x12\x0f\n\x0bPERFORMANCE\x10\x03\x12\x11\n\rMANAGEABILITY\x10\x04\x12\x12\n\x0eSUSTAINABILITY\x10\x05\x12\x0f\n\x0bRELIABILITY\x10\x06\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04:\x9f\x03\xea\x41\x9b\x03\n\"recommender.googleapis.com/Insight\x12Vprojects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12\x65\x62illingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12Tfolders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12`organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\"\xaf\x02\n\x10InsightStateInfo\x12\x42\n\x05state\x18\x01 \x01(\x0e\x32\x33.google.cloud.recommender.v1.InsightStateInfo.State\x12X\n\x0estate_metadata\x18\x02 \x03(\x0b\x32@.google.cloud.recommender.v1.InsightStateInfo.StateMetadataEntry\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x02\x12\r\n\tDISMISSED\x10\x03\x42\xf0\x03\n\x1f\x63om.google.cloud.recommender.v1B\x0cInsightProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.V1\xea\x41\xd3\x02\n&recommender.googleapis.com/InsightType\x12\x43projects/{project}/locations/{location}/insightTypes/{insight_type}\x12RbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}\x12\x41\x66olders/{folder}/locations/{location}/insightTypes/{insight_type}\x12Morganizations/{organization}/locations/{location}/insightTypes/{insight_type}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.Struct", "google/protobuf/struct.proto"], + ["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 Recommender + module V1 + Insight = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight").msgclass + Insight::RecommendationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.RecommendationReference").msgclass + Insight::Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.Category").enummodule + Insight::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.Severity").enummodule + InsightStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo").msgclass + InsightStateInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb new file mode 100644 index 000000000000..525fb217f973 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommender/v1/insight_type_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/recommender/v1/insight_type_config.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x05\n\x11InsightTypeConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12`\n\x1einsight_type_generation_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.recommender.v1.InsightTypeGenerationConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0brevision_id\x18\x05 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x06 \x03(\x0b\x32?.google.cloud.recommender.v1.InsightTypeConfig.AnnotationsEntry\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xaf\x02\xea\x41\xab\x02\n,recommender.googleapis.com/InsightTypeConfig\x12Jprojects/{project}/locations/{location}/insightTypes/{insight_type}/config\x12Torganizations/{organization}/locations/{location}/insightTypes/{insight_type}/config\x12YbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config\"F\n\x1bInsightTypeGenerationConfig\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\xa3\x01\n\x1f\x63om.google.cloud.recommender.v1B\x16InsightTypeConfigProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.Struct", "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 Recommender + module V1 + InsightTypeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeConfig").msgclass + InsightTypeGenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeGenerationConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb new file mode 100644 index 000000000000..216c86339922 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommender/v1/recommendation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/money_pb' + + +descriptor_data = "\n0google/cloud/recommender/v1/recommendation.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/money.proto\"\xa2\t\n\x0eRecommendation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x1b\n\x13recommender_subtype\x18\x0c \x01(\t\x12\x35\n\x11last_refresh_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12;\n\x0eprimary_impact\x18\x05 \x01(\x0b\x32#.google.cloud.recommender.v1.Impact\x12>\n\x11\x61\x64\x64itional_impact\x18\x06 \x03(\x0b\x32#.google.cloud.recommender.v1.Impact\x12\x46\n\x08priority\x18\x11 \x01(\x0e\x32\x34.google.cloud.recommender.v1.Recommendation.Priority\x12\x43\n\x07\x63ontent\x18\x07 \x01(\x0b\x32\x32.google.cloud.recommender.v1.RecommendationContent\x12H\n\nstate_info\x18\n \x01(\x0b\x32\x34.google.cloud.recommender.v1.RecommendationStateInfo\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12Y\n\x13\x61ssociated_insights\x18\x0e \x03(\x0b\x32<.google.cloud.recommender.v1.Recommendation.InsightReference\x12\x14\n\x0cxor_group_id\x18\x12 \x01(\t\x1a#\n\x10InsightReference\x12\x0f\n\x07insight\x18\x01 \x01(\t\"D\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P4\x10\x01\x12\x06\n\x02P3\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P1\x10\x04:\xda\x03\xea\x41\xd6\x03\n)recommender.googleapis.com/Recommendation\x12\x63projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12rbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12\x61\x66olders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12morganizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\"\x89\x01\n\x15RecommendationContent\x12\x45\n\x10operation_groups\x18\x02 \x03(\x0b\x32+.google.cloud.recommender.v1.OperationGroup\x12)\n\x08overview\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"L\n\x0eOperationGroup\x12:\n\noperations\x18\x01 \x03(\x0b\x32&.google.cloud.recommender.v1.Operation\"\xd7\x04\n\tOperation\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0c\n\x04path\x18\x04 \x01(\t\x12\x17\n\x0fsource_resource\x18\x05 \x01(\t\x12\x13\n\x0bsource_path\x18\x06 \x01(\t\x12\'\n\x05value\x18\x07 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x42\n\rvalue_matcher\x18\n \x01(\x0b\x32).google.cloud.recommender.v1.ValueMatcherH\x00\x12M\n\x0cpath_filters\x18\x08 \x03(\x0b\x32\x37.google.cloud.recommender.v1.Operation.PathFiltersEntry\x12Z\n\x13path_value_matchers\x18\x0b \x03(\x0b\x32=.google.cloud.recommender.v1.Operation.PathValueMatchersEntry\x1aJ\n\x10PathFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x63\n\x16PathValueMatchersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.recommender.v1.ValueMatcher:\x02\x38\x01\x42\x0c\n\npath_value\":\n\x0cValueMatcher\x12\x19\n\x0fmatches_pattern\x18\x01 \x01(\tH\x00\x42\x0f\n\rmatch_variant\"\x93\x01\n\x0e\x43ostProjection\x12 \n\x04\x63ost\x18\x01 \x01(\x0b\x32\x12.google.type.Money\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x16\x63ost_in_local_currency\x18\x03 \x01(\x0b\x32\x12.google.type.Money\">\n\x12SecurityProjection\x12(\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"Y\n\x18SustainabilityProjection\x12\x10\n\x08kg_c_o2e\x18\x01 \x01(\x01\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xec\x01\n\x15ReliabilityProjection\x12J\n\x05risks\x18\x01 \x03(\x0e\x32;.google.cloud.recommender.v1.ReliabilityProjection.RiskType\x12(\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"]\n\x08RiskType\x12\x19\n\x15RISK_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12SERVICE_DISRUPTION\x10\x01\x12\r\n\tDATA_LOSS\x10\x02\x12\x0f\n\x0b\x41\x43\x43\x45SS_DENY\x10\x03\"\xa8\x04\n\x06Impact\x12>\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32,.google.cloud.recommender.v1.Impact.Category\x12\x46\n\x0f\x63ost_projection\x18\x64 \x01(\x0b\x32+.google.cloud.recommender.v1.CostProjectionH\x00\x12N\n\x13security_projection\x18\x65 \x01(\x0b\x32/.google.cloud.recommender.v1.SecurityProjectionH\x00\x12Z\n\x19sustainability_projection\x18\x66 \x01(\x0b\x32\x35.google.cloud.recommender.v1.SustainabilityProjectionH\x00\x12T\n\x16reliability_projection\x18g \x01(\x0b\x32\x32.google.cloud.recommender.v1.ReliabilityProjectionH\x00\"\x85\x01\n\x08\x43\x61tegory\x12\x18\n\x14\x43\x41TEGORY_UNSPECIFIED\x10\x00\x12\x08\n\x04\x43OST\x10\x01\x12\x0c\n\x08SECURITY\x10\x02\x12\x0f\n\x0bPERFORMANCE\x10\x03\x12\x11\n\rMANAGEABILITY\x10\x04\x12\x12\n\x0eSUSTAINABILITY\x10\x05\x12\x0f\n\x0bRELIABILITY\x10\x06\x42\x0c\n\nprojection\"\xde\x02\n\x17RecommendationStateInfo\x12I\n\x05state\x18\x01 \x01(\x0e\x32:.google.cloud.recommender.v1.RecommendationStateInfo.State\x12_\n\x0estate_metadata\x18\x02 \x03(\x0b\x32G.google.cloud.recommender.v1.RecommendationStateInfo.StateMetadataEntry\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"a\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x43LAIMED\x10\x06\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tDISMISSED\x10\x05\x42\xde\x03\n\x1f\x63om.google.cloud.recommender.v1P\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.V1\xea\x41\xcf\x02\n&recommender.googleapis.com/Recommender\x12\x42projects/{project}/locations/{location}/recommenders/{recommender}\x12QbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}\x12@folders/{folder}/locations/{location}/recommenders/{recommender}\x12Lorganizations/{organization}/locations/{location}/recommenders/{recommender}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.Struct", "google/protobuf/struct.proto"], + ["google.type.Money", "google/type/money.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 Recommender + module V1 + Recommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation").msgclass + Recommendation::InsightReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation.InsightReference").msgclass + Recommendation::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation.Priority").enummodule + RecommendationContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationContent").msgclass + OperationGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.OperationGroup").msgclass + Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Operation").msgclass + ValueMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ValueMatcher").msgclass + CostProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.CostProjection").msgclass + SecurityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.SecurityProjection").msgclass + SustainabilityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.SustainabilityProjection").msgclass + ReliabilityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ReliabilityProjection").msgclass + ReliabilityProjection::RiskType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ReliabilityProjection.RiskType").enummodule + Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Impact").msgclass + Impact::Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Impact.Category").enummodule + RecommendationStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationStateInfo").msgclass + RecommendationStateInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationStateInfo.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb new file mode 100644 index 000000000000..4d8007819497 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.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/recommender/v1/version" + +require "google/cloud/recommender/v1/recommender/credentials" +require "google/cloud/recommender/v1/recommender/paths" +require "google/cloud/recommender/v1/recommender/client" +require "google/cloud/recommender/v1/recommender/rest" + +module Google + module Cloud + module Recommender + module V1 + ## + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/recommender/v1/recommender" + # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/recommender/v1/recommender/rest" + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + module Recommender + end + end + end + end +end + +helper_path = ::File.join __dir__, "recommender", "helpers.rb" +require "google/cloud/recommender/v1/recommender/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb new file mode 100644 index 000000000000..1e835e67a47e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb @@ -0,0 +1,1837 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommender/v1/recommender_service_pb" + +module Google + module Cloud + module Recommender + module V1 + module Recommender + ## + # Client for the Recommender service. + # + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommender.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommender_stub + + ## + # Configure the Recommender Client class. + # + # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Recommender clients + # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Recommender", "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_insights.timeout = 60.0 + default_config.rpcs.list_insights.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_insight.timeout = 60.0 + default_config.rpcs.get_insight.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.mark_insight_accepted.timeout = 60.0 + + default_config.rpcs.list_recommendations.timeout = 60.0 + default_config.rpcs.list_recommendations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_recommendation.timeout = 60.0 + default_config.rpcs.get_recommendation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.mark_recommendation_claimed.timeout = 60.0 + + default_config.rpcs.mark_recommendation_succeeded.timeout = 60.0 + + default_config.rpcs.mark_recommendation_failed.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Recommender Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recommender_stub.universe_domain + end + + ## + # Create a new Recommender client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Recommender 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/recommender/v1/recommender_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 + + @recommender_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Recommender::V1::Recommender::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 + ) + + @recommender_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 + @recommender_stub.logger + end + + # Service calls + + ## + # Lists insights for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified insight type. + # + # @overload list_insights(request, options = nil) + # Pass arguments to `list_insights` via a request object, either of type + # {::Google::Cloud::Recommender::V1::ListInsightsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_insights` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # INSIGHT_TYPE_ID refers to supported insight types: + # https://cloud.google.com/recommender/docs/insights/insight-types. + # @param page_size [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @param page_token [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @param filter [::String] + # Optional. Filter expression to restrict the insights returned. Supported + # filter fields: + # + # * `stateInfo.state` + # + # * `insightSubtype` + # + # * `severity` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `insightSubtype = PERMISSIONS_USAGE` + # + # * `severity = CRITICAL OR severity = HIGH` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::ListInsightsRequest.new + # + # # Call the list_insights method. + # result = client.list_insights request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Recommender::V1::Insight. + # p item + # end + # + def list_insights request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_insights.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_insights.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_insights.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :list_insights, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_insights, request, response, 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 requested insight. Requires the recommender.*.get IAM permission + # for the specified insight type. + # + # @overload get_insight(request, options = nil) + # Pass arguments to `get_insight` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetInsightRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetInsightRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_insight(name: nil) + # Pass arguments to `get_insight` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 insight. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetInsightRequest.new + # + # # Call the get_insight method. + # result = client.get_insight request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Insight. + # p result + # + def get_insight request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_insight.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_insight.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_insight.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :get_insight, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Insight State as Accepted. Users can use this method to + # indicate to the Recommender API that they have applied some action based + # on the insight. This stops the insight content from being updated. + # + # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + # the recommender.*.update IAM permission for the specified insight. + # + # @overload mark_insight_accepted(request, options = nil) + # Pass arguments to `mark_insight_accepted` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mark_insight_accepted(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_insight_accepted` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 insight. + # @param state_metadata [::Hash{::String => ::String}] + # Optional. State properties user wish to include with this state. Full + # replace of the current state_metadata. + # @param etag [::String] + # Required. Fingerprint of the Insight. Provides optimistic locking. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new + # + # # Call the mark_insight_accepted method. + # result = client.mark_insight_accepted request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Insight. + # p result + # + def mark_insight_accepted request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mark_insight_accepted.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mark_insight_accepted.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :mark_insight_accepted, request, 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 recommendations for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified recommender. + # + # @overload list_recommendations(request, options = nil) + # Pass arguments to `list_recommendations` via a request object, either of type + # {::Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_recommendations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # RECOMMENDER_ID refers to supported recommenders: + # https://cloud.google.com/recommender/docs/recommenders. + # @param page_size [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @param page_token [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @param filter [::String] + # Filter expression to restrict the recommendations returned. Supported + # filter fields: + # + # * `state_info.state` + # + # * `recommenderSubtype` + # + # * `priority` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + # + # * `priority = P1 OR priority = P2` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new + # + # # Call the list_recommendations method. + # result = client.list_recommendations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. + # p item + # end + # + def list_recommendations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_recommendations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_recommendations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_recommendations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :list_recommendations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_recommendations, request, response, 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 requested recommendation. Requires the recommender.*.get + # IAM permission for the specified recommender. + # + # @overload get_recommendation(request, options = nil) + # Pass arguments to `get_recommendation` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_recommendation(name: nil) + # Pass arguments to `get_recommendation` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new + # + # # Call the get_recommendation method. + # result = client.get_recommendation request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def get_recommendation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_recommendation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_recommendation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_recommendation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :get_recommendation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Mark the Recommendation State as Dismissed. Users can use this method to + # indicate to the Recommender API that an ACTIVE recommendation has to + # be marked back as DISMISSED. + # + # MarkRecommendationDismissed can be applied to recommendations in ACTIVE + # state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_dismissed(request, options = nil) + # Pass arguments to `mark_recommendation_dismissed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mark_recommendation_dismissed(name: nil, etag: nil) + # Pass arguments to `mark_recommendation_dismissed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param etag [::String] + # Fingerprint of the Recommendation. Provides optimistic locking. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new + # + # # Call the mark_recommendation_dismissed method. + # result = client.mark_recommendation_dismissed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_dismissed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mark_recommendation_dismissed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_dismissed.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mark_recommendation_dismissed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :mark_recommendation_dismissed, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Claimed. Users can use this method to + # indicate to the Recommender API that they are starting to apply the + # recommendation themselves. This stops the recommendation content from being + # updated. Associated insights are frozen and placed in the ACCEPTED state. + # + # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + # SUCCEEDED, FAILED, or ACTIVE state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_claimed(request, options = nil) + # Pass arguments to `mark_recommendation_claimed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_claimed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new + # + # # Call the mark_recommendation_claimed method. + # result = client.mark_recommendation_claimed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_claimed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mark_recommendation_claimed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :mark_recommendation_claimed, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Succeeded. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation was successful. This stops the recommendation + # content from being updated. Associated insights are frozen and placed in + # the ACCEPTED state. + # + # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_succeeded(request, options = nil) + # Pass arguments to `mark_recommendation_succeeded` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_succeeded` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new + # + # # Call the mark_recommendation_succeeded method. + # result = client.mark_recommendation_succeeded request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_succeeded request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mark_recommendation_succeeded.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :mark_recommendation_succeeded, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Failed. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation failed. This stops the recommendation content + # from being updated. Associated insights are frozen and placed in the + # ACCEPTED state. + # + # MarkRecommendationFailed can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_failed(request, options = nil) + # Pass arguments to `mark_recommendation_failed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_failed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new + # + # # Call the mark_recommendation_failed method. + # result = client.mark_recommendation_failed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_failed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.mark_recommendation_failed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout, + metadata: metadata, + retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :mark_recommendation_failed, request, 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 requested Recommender Config. There is only one instance of the + # config for each Recommender. + # + # @overload get_recommender_config(request, options = nil) + # Pass arguments to `get_recommender_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_recommender_config(name: nil) + # Pass arguments to `get_recommender_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the Recommendation Config to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new + # + # # Call the get_recommender_config method. + # result = client.get_recommender_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + # p result + # + def get_recommender_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_recommender_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::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_recommender_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_recommender_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :get_recommender_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 Recommender Config. This will create a new revision of the + # config. + # + # @overload update_recommender_config(request, options = nil) + # Pass arguments to `update_recommender_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recommender_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 recommender_config [::Google::Cloud::Recommender::V1::RecommenderConfig, ::Hash] + # Required. The RecommenderConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @param validate_only [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new + # + # # Call the update_recommender_config method. + # result = client.update_recommender_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + # p result + # + def update_recommender_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest + + # Converts hash and nil to 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_recommender_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::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.recommender_config&.name + header_params["recommender_config.name"] = request.recommender_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_recommender_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_recommender_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :update_recommender_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the requested InsightTypeConfig. There is only one instance of the + # config for each InsightType. + # + # @overload get_insight_type_config(request, options = nil) + # Pass arguments to `get_insight_type_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_insight_type_config(name: nil) + # Pass arguments to `get_insight_type_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the InsightTypeConfig to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new + # + # # Call the get_insight_type_config method. + # result = client.get_insight_type_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + # p result + # + def get_insight_type_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_insight_type_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::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_insight_type_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :get_insight_type_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an InsightTypeConfig change. This will create a new revision of the + # config. + # + # @overload update_insight_type_config(request, options = nil) + # Pass arguments to `update_insight_type_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_insight_type_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 insight_type_config [::Google::Cloud::Recommender::V1::InsightTypeConfig, ::Hash] + # Required. The InsightTypeConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @param validate_only [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new + # + # # Call the update_insight_type_config method. + # result = client.update_insight_type_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + # p result + # + def update_insight_type_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest + + # Converts hash and nil to 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_insight_type_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::Recommender::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.insight_type_config&.name + header_params["insight_type_config.name"] = request.insight_type_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_insight_type_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_insight_type_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.call_rpc :update_insight_type_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 + + ## + # Configuration class for the Recommender API. + # + # This class represents the configuration for Recommender, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_insights to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_insights.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_insights.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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::Recommender::V1::Recommender::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 = "recommender.googleapis.com" + + config_attr :endpoint, nil, ::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 Recommender API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_insights` + # @return [::Gapic::Config::Method] + # + attr_reader :list_insights + ## + # RPC-specific configuration for `get_insight` + # @return [::Gapic::Config::Method] + # + attr_reader :get_insight + ## + # RPC-specific configuration for `mark_insight_accepted` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_insight_accepted + ## + # RPC-specific configuration for `list_recommendations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recommendations + ## + # RPC-specific configuration for `get_recommendation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recommendation + ## + # RPC-specific configuration for `mark_recommendation_dismissed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_dismissed + ## + # RPC-specific configuration for `mark_recommendation_claimed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_claimed + ## + # RPC-specific configuration for `mark_recommendation_succeeded` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_succeeded + ## + # RPC-specific configuration for `mark_recommendation_failed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_failed + ## + # RPC-specific configuration for `get_recommender_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recommender_config + ## + # RPC-specific configuration for `update_recommender_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recommender_config + ## + # RPC-specific configuration for `get_insight_type_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_insight_type_config + ## + # RPC-specific configuration for `update_insight_type_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_insight_type_config + + # @private + def initialize parent_rpcs = nil + list_insights_config = parent_rpcs.list_insights if parent_rpcs.respond_to? :list_insights + @list_insights = ::Gapic::Config::Method.new list_insights_config + get_insight_config = parent_rpcs.get_insight if parent_rpcs.respond_to? :get_insight + @get_insight = ::Gapic::Config::Method.new get_insight_config + mark_insight_accepted_config = parent_rpcs.mark_insight_accepted if parent_rpcs.respond_to? :mark_insight_accepted + @mark_insight_accepted = ::Gapic::Config::Method.new mark_insight_accepted_config + list_recommendations_config = parent_rpcs.list_recommendations if parent_rpcs.respond_to? :list_recommendations + @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config + get_recommendation_config = parent_rpcs.get_recommendation if parent_rpcs.respond_to? :get_recommendation + @get_recommendation = ::Gapic::Config::Method.new get_recommendation_config + mark_recommendation_dismissed_config = parent_rpcs.mark_recommendation_dismissed if parent_rpcs.respond_to? :mark_recommendation_dismissed + @mark_recommendation_dismissed = ::Gapic::Config::Method.new mark_recommendation_dismissed_config + mark_recommendation_claimed_config = parent_rpcs.mark_recommendation_claimed if parent_rpcs.respond_to? :mark_recommendation_claimed + @mark_recommendation_claimed = ::Gapic::Config::Method.new mark_recommendation_claimed_config + mark_recommendation_succeeded_config = parent_rpcs.mark_recommendation_succeeded if parent_rpcs.respond_to? :mark_recommendation_succeeded + @mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config + mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed + @mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config + get_recommender_config_config = parent_rpcs.get_recommender_config if parent_rpcs.respond_to? :get_recommender_config + @get_recommender_config = ::Gapic::Config::Method.new get_recommender_config_config + update_recommender_config_config = parent_rpcs.update_recommender_config if parent_rpcs.respond_to? :update_recommender_config + @update_recommender_config = ::Gapic::Config::Method.new update_recommender_config_config + get_insight_type_config_config = parent_rpcs.get_insight_type_config if parent_rpcs.respond_to? :get_insight_type_config + @get_insight_type_config = ::Gapic::Config::Method.new get_insight_type_config_config + update_insight_type_config_config = parent_rpcs.update_insight_type_config if parent_rpcs.respond_to? :update_insight_type_config + @update_insight_type_config = ::Gapic::Config::Method.new update_insight_type_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb new file mode 100644 index 000000000000..acb6161ca759 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/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 Recommender + module V1 + module Recommender + # Credentials for the Recommender API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "RECOMMENDER_CREDENTIALS", + "RECOMMENDER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "RECOMMENDER_CREDENTIALS_JSON", + "RECOMMENDER_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-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb new file mode 100644 index 000000000000..89366822975a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb @@ -0,0 +1,457 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + module Recommender + # Path helper methods for the Recommender API. + module Paths + ## + # Create a fully-qualified Insight resource string. + # + # @overload insight_path(project:, location:, insight_type:, insight:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` + # + # @param project [String] + # @param location [String] + # @param insight_type [String] + # @param insight [String] + # + # @overload insight_path(billing_account:, location:, insight_type:, insight:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` + # + # @param billing_account [String] + # @param location [String] + # @param insight_type [String] + # @param insight [String] + # + # @overload insight_path(folder:, location:, insight_type:, insight:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` + # + # @param folder [String] + # @param location [String] + # @param insight_type [String] + # @param insight [String] + # + # @overload insight_path(organization:, location:, insight_type:, insight:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` + # + # @param organization [String] + # @param location [String] + # @param insight_type [String] + # @param insight [String] + # + # @return [::String] + def insight_path **args + resources = { + "insight:insight_type:location:project" => (proc do |project:, location:, insight_type:, insight:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" + + "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" + end), + "billing_account:insight:insight_type:location" => (proc do |billing_account:, location:, insight_type:, insight:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" + end), + "folder:insight:insight_type:location" => (proc do |folder:, location:, insight_type:, insight:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" + end), + "insight:insight_type:location:organization" => (proc do |organization:, location:, insight_type:, insight:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" + 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 InsightType resource string. + # + # @overload insight_type_path(project:, location:, insight_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/insightTypes/{insight_type}` + # + # @param project [String] + # @param location [String] + # @param insight_type [String] + # + # @overload insight_type_path(billing_account:, location:, insight_type:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}` + # + # @param billing_account [String] + # @param location [String] + # @param insight_type [String] + # + # @overload insight_type_path(folder:, location:, insight_type:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/insightTypes/{insight_type}` + # + # @param folder [String] + # @param location [String] + # @param insight_type [String] + # + # @overload insight_type_path(organization:, location:, insight_type:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}` + # + # @param organization [String] + # @param location [String] + # @param insight_type [String] + # + # @return [::String] + def insight_type_path **args + resources = { + "insight_type:location:project" => (proc do |project:, location:, insight_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}" + end), + "billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}" + end), + "folder:insight_type:location" => (proc do |folder:, location:, insight_type:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}" + end), + "insight_type:location:organization" => (proc do |organization:, location:, insight_type:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}" + 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 InsightTypeConfig resource string. + # + # @overload insight_type_config_path(project:, location:, insight_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/insightTypes/{insight_type}/config` + # + # @param project [String] + # @param location [String] + # @param insight_type [String] + # + # @overload insight_type_config_path(organization:, location:, insight_type:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config` + # + # @param organization [String] + # @param location [String] + # @param insight_type [String] + # + # @overload insight_type_config_path(billing_account:, location:, insight_type:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config` + # + # @param billing_account [String] + # @param location [String] + # @param insight_type [String] + # + # @return [::String] + def insight_type_config_path **args + resources = { + "insight_type:location:project" => (proc do |project:, location:, insight_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/config" + end), + "insight_type:location:organization" => (proc do |organization:, location:, insight_type:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/config" + end), + "billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/config" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Recommendation resource string. + # + # @overload recommendation_path(project:, location:, recommender:, recommendation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` + # + # @param project [String] + # @param location [String] + # @param recommender [String] + # @param recommendation [String] + # + # @overload recommendation_path(billing_account:, location:, recommender:, recommendation:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` + # + # @param billing_account [String] + # @param location [String] + # @param recommender [String] + # @param recommendation [String] + # + # @overload recommendation_path(folder:, location:, recommender:, recommendation:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` + # + # @param folder [String] + # @param location [String] + # @param recommender [String] + # @param recommendation [String] + # + # @overload recommendation_path(organization:, location:, recommender:, recommendation:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` + # + # @param organization [String] + # @param location [String] + # @param recommender [String] + # @param recommendation [String] + # + # @return [::String] + def recommendation_path **args + resources = { + "location:project:recommendation:recommender" => (proc do |project:, location:, recommender:, recommendation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" + + "projects/#{project}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" + end), + "billing_account:location:recommendation:recommender" => (proc do |billing_account:, location:, recommender:, recommendation:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" + end), + "folder:location:recommendation:recommender" => (proc do |folder:, location:, recommender:, recommendation:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" + end), + "location:organization:recommendation:recommender" => (proc do |organization:, location:, recommender:, recommendation:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" + 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 Recommender resource string. + # + # @overload recommender_path(project:, location:, recommender:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/recommenders/{recommender}` + # + # @param project [String] + # @param location [String] + # @param recommender [String] + # + # @overload recommender_path(billing_account:, location:, recommender:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}` + # + # @param billing_account [String] + # @param location [String] + # @param recommender [String] + # + # @overload recommender_path(folder:, location:, recommender:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/recommenders/{recommender}` + # + # @param folder [String] + # @param location [String] + # @param recommender [String] + # + # @overload recommender_path(organization:, location:, recommender:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/recommenders/{recommender}` + # + # @param organization [String] + # @param location [String] + # @param recommender [String] + # + # @return [::String] + def recommender_path **args + resources = { + "location:project:recommender" => (proc do |project:, location:, recommender:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/recommenders/#{recommender}" + end), + "billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}" + end), + "folder:location:recommender" => (proc do |folder:, location:, recommender:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/recommenders/#{recommender}" + end), + "location:organization:recommender" => (proc do |organization:, location:, recommender:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}" + 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 RecommenderConfig resource string. + # + # @overload recommender_config_path(project:, location:, recommender:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/recommenders/{recommender}/config` + # + # @param project [String] + # @param location [String] + # @param recommender [String] + # + # @overload recommender_config_path(organization:, location:, recommender:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/recommenders/{recommender}/config` + # + # @param organization [String] + # @param location [String] + # @param recommender [String] + # + # @overload recommender_config_path(billing_account:, location:, recommender:) + # The resource will be in the following format: + # + # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config` + # + # @param billing_account [String] + # @param location [String] + # @param recommender [String] + # + # @return [::String] + def recommender_config_path **args + resources = { + "location:project:recommender" => (proc do |project:, location:, recommender:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/recommenders/#{recommender}/config" + end), + "location:organization:recommender" => (proc do |organization:, location:, recommender:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/config" + end), + "billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:| + raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/config" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb new file mode 100644 index 000000000000..60528db6ec70 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/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/recommender/v1/version" + +require "google/cloud/recommender/v1/recommender/credentials" +require "google/cloud/recommender/v1/recommender/paths" +require "google/cloud/recommender/v1/recommender/rest/client" + +module Google + module Cloud + module Recommender + module V1 + ## + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/recommender/v1/recommender/rest" + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + module Recommender + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/recommender/v1/recommender/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb new file mode 100644 index 000000000000..cec4771e7261 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb @@ -0,0 +1,1703 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/recommender/v1/recommender_service_pb" +require "google/cloud/recommender/v1/recommender/rest/service_stub" + +module Google + module Cloud + module Recommender + module V1 + module Recommender + module Rest + ## + # REST client for the Recommender service. + # + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "recommender.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommender_stub + + ## + # Configure the Recommender Client class. + # + # See {::Google::Cloud::Recommender::V1::Recommender::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Recommender clients + # ::Google::Cloud::Recommender::V1::Recommender::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", "Recommender", "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_insights.timeout = 60.0 + default_config.rpcs.list_insights.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_insight.timeout = 60.0 + default_config.rpcs.get_insight.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.mark_insight_accepted.timeout = 60.0 + + default_config.rpcs.list_recommendations.timeout = 60.0 + default_config.rpcs.list_recommendations.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_recommendation.timeout = 60.0 + default_config.rpcs.get_recommendation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.mark_recommendation_claimed.timeout = 60.0 + + default_config.rpcs.mark_recommendation_succeeded.timeout = 60.0 + + default_config.rpcs.mark_recommendation_failed.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Recommender Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Recommender::V1::Recommender::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 + @recommender_stub.universe_domain + end + + ## + # Create a new Recommender REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Recommender 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 + + @recommender_stub = ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @recommender_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 + @recommender_stub.logger + end + + # Service calls + + ## + # Lists insights for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified insight type. + # + # @overload list_insights(request, options = nil) + # Pass arguments to `list_insights` via a request object, either of type + # {::Google::Cloud::Recommender::V1::ListInsightsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_insights` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # INSIGHT_TYPE_ID refers to supported insight types: + # https://cloud.google.com/recommender/docs/insights/insight-types. + # @param page_size [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @param page_token [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @param filter [::String] + # Optional. Filter expression to restrict the insights returned. Supported + # filter fields: + # + # * `stateInfo.state` + # + # * `insightSubtype` + # + # * `severity` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `insightSubtype = PERMISSIONS_USAGE` + # + # * `severity = CRITICAL OR severity = HIGH` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::ListInsightsRequest.new + # + # # Call the list_insights method. + # result = client.list_insights request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Recommender::V1::Insight. + # p item + # end + # + def list_insights request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_insights.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_insights.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_insights.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.list_insights request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_insights, "insights", request, result, 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 requested insight. Requires the recommender.*.get IAM permission + # for the specified insight type. + # + # @overload get_insight(request, options = nil) + # Pass arguments to `get_insight` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetInsightRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetInsightRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_insight(name: nil) + # Pass arguments to `get_insight` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 insight. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetInsightRequest.new + # + # # Call the get_insight method. + # result = client.get_insight request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Insight. + # p result + # + def get_insight request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_insight.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_insight.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_insight.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.get_insight request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Insight State as Accepted. Users can use this method to + # indicate to the Recommender API that they have applied some action based + # on the insight. This stops the insight content from being updated. + # + # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + # the recommender.*.update IAM permission for the specified insight. + # + # @overload mark_insight_accepted(request, options = nil) + # Pass arguments to `mark_insight_accepted` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mark_insight_accepted(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_insight_accepted` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 insight. + # @param state_metadata [::Hash{::String => ::String}] + # Optional. State properties user wish to include with this state. Full + # replace of the current state_metadata. + # @param etag [::String] + # Required. Fingerprint of the Insight. Provides optimistic locking. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new + # + # # Call the mark_insight_accepted method. + # result = client.mark_insight_accepted request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Insight. + # p result + # + def mark_insight_accepted request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mark_insight_accepted.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mark_insight_accepted.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.mark_insight_accepted request, 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 recommendations for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified recommender. + # + # @overload list_recommendations(request, options = nil) + # Pass arguments to `list_recommendations` via a request object, either of type + # {::Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_recommendations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # RECOMMENDER_ID refers to supported recommenders: + # https://cloud.google.com/recommender/docs/recommenders. + # @param page_size [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @param page_token [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @param filter [::String] + # Filter expression to restrict the recommendations returned. Supported + # filter fields: + # + # * `state_info.state` + # + # * `recommenderSubtype` + # + # * `priority` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + # + # * `priority = P1 OR priority = P2` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new + # + # # Call the list_recommendations method. + # result = client.list_recommendations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. + # p item + # end + # + def list_recommendations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_recommendations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_recommendations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_recommendations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.list_recommendations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_recommendations, "recommendations", request, result, 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 requested recommendation. Requires the recommender.*.get + # IAM permission for the specified recommender. + # + # @overload get_recommendation(request, options = nil) + # Pass arguments to `get_recommendation` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_recommendation(name: nil) + # Pass arguments to `get_recommendation` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new + # + # # Call the get_recommendation method. + # result = client.get_recommendation request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def get_recommendation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_recommendation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_recommendation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_recommendation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.get_recommendation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Mark the Recommendation State as Dismissed. Users can use this method to + # indicate to the Recommender API that an ACTIVE recommendation has to + # be marked back as DISMISSED. + # + # MarkRecommendationDismissed can be applied to recommendations in ACTIVE + # state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_dismissed(request, options = nil) + # Pass arguments to `mark_recommendation_dismissed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mark_recommendation_dismissed(name: nil, etag: nil) + # Pass arguments to `mark_recommendation_dismissed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param etag [::String] + # Fingerprint of the Recommendation. Provides optimistic locking. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new + # + # # Call the mark_recommendation_dismissed method. + # result = client.mark_recommendation_dismissed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_dismissed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mark_recommendation_dismissed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_dismissed.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mark_recommendation_dismissed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.mark_recommendation_dismissed request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Claimed. Users can use this method to + # indicate to the Recommender API that they are starting to apply the + # recommendation themselves. This stops the recommendation content from being + # updated. Associated insights are frozen and placed in the ACCEPTED state. + # + # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + # SUCCEEDED, FAILED, or ACTIVE state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_claimed(request, options = nil) + # Pass arguments to `mark_recommendation_claimed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_claimed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new + # + # # Call the mark_recommendation_claimed method. + # result = client.mark_recommendation_claimed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_claimed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mark_recommendation_claimed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.mark_recommendation_claimed request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Succeeded. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation was successful. This stops the recommendation + # content from being updated. Associated insights are frozen and placed in + # the ACCEPTED state. + # + # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_succeeded(request, options = nil) + # Pass arguments to `mark_recommendation_succeeded` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_succeeded` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new + # + # # Call the mark_recommendation_succeeded method. + # result = client.mark_recommendation_succeeded request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_succeeded request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mark_recommendation_succeeded.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.mark_recommendation_succeeded request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks the Recommendation State as Failed. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation failed. This stops the recommendation content + # from being updated. Associated insights are frozen and placed in the + # ACCEPTED state. + # + # MarkRecommendationFailed can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + # + # @overload mark_recommendation_failed(request, options = nil) + # Pass arguments to `mark_recommendation_failed` via a request object, either of type + # {::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil) + # Pass arguments to `mark_recommendation_failed` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 recommendation. + # @param state_metadata [::Hash{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @param etag [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new + # + # # Call the mark_recommendation_failed method. + # result = client.mark_recommendation_failed request + # + # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + # p result + # + def mark_recommendation_failed request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.mark_recommendation_failed.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.mark_recommendation_failed request, 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 requested Recommender Config. There is only one instance of the + # config for each Recommender. + # + # @overload get_recommender_config(request, options = nil) + # Pass arguments to `get_recommender_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_recommender_config(name: nil) + # Pass arguments to `get_recommender_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the Recommendation Config to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new + # + # # Call the get_recommender_config method. + # result = client.get_recommender_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + # p result + # + def get_recommender_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_recommender_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::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_recommender_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_recommender_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.get_recommender_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 Recommender Config. This will create a new revision of the + # config. + # + # @overload update_recommender_config(request, options = nil) + # Pass arguments to `update_recommender_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_recommender_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 recommender_config [::Google::Cloud::Recommender::V1::RecommenderConfig, ::Hash] + # Required. The RecommenderConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @param validate_only [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new + # + # # Call the update_recommender_config method. + # result = client.update_recommender_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + # p result + # + def update_recommender_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest + + # Converts hash and nil to an 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_recommender_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::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_recommender_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_recommender_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.update_recommender_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the requested InsightTypeConfig. There is only one instance of the + # config for each InsightType. + # + # @overload get_insight_type_config(request, options = nil) + # Pass arguments to `get_insight_type_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_insight_type_config(name: nil) + # Pass arguments to `get_insight_type_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the InsightTypeConfig to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new + # + # # Call the get_insight_type_config method. + # result = client.get_insight_type_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + # p result + # + def get_insight_type_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_insight_type_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::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_insight_type_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.get_insight_type_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an InsightTypeConfig change. This will create a new revision of the + # config. + # + # @overload update_insight_type_config(request, options = nil) + # Pass arguments to `update_insight_type_config` via a request object, either of type + # {::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil) + # Pass arguments to `update_insight_type_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 insight_type_config [::Google::Cloud::Recommender::V1::InsightTypeConfig, ::Hash] + # Required. The InsightTypeConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @param validate_only [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/recommender/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new + # + # # Call the update_insight_type_config method. + # result = client.update_insight_type_config request + # + # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + # p result + # + def update_insight_type_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest + + # Converts hash and nil to an 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_insight_type_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::Recommender::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_insight_type_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_insight_type_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommender_stub.update_insight_type_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Recommender REST API. + # + # This class represents the configuration for Recommender 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::Recommender::V1::Recommender::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_insights to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_insights.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_insights.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint 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 = "recommender.googleapis.com" + + config_attr :endpoint, nil, ::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 Recommender API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_insights` + # @return [::Gapic::Config::Method] + # + attr_reader :list_insights + ## + # RPC-specific configuration for `get_insight` + # @return [::Gapic::Config::Method] + # + attr_reader :get_insight + ## + # RPC-specific configuration for `mark_insight_accepted` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_insight_accepted + ## + # RPC-specific configuration for `list_recommendations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_recommendations + ## + # RPC-specific configuration for `get_recommendation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recommendation + ## + # RPC-specific configuration for `mark_recommendation_dismissed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_dismissed + ## + # RPC-specific configuration for `mark_recommendation_claimed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_claimed + ## + # RPC-specific configuration for `mark_recommendation_succeeded` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_succeeded + ## + # RPC-specific configuration for `mark_recommendation_failed` + # @return [::Gapic::Config::Method] + # + attr_reader :mark_recommendation_failed + ## + # RPC-specific configuration for `get_recommender_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_recommender_config + ## + # RPC-specific configuration for `update_recommender_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_recommender_config + ## + # RPC-specific configuration for `get_insight_type_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_insight_type_config + ## + # RPC-specific configuration for `update_insight_type_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_insight_type_config + + # @private + def initialize parent_rpcs = nil + list_insights_config = parent_rpcs.list_insights if parent_rpcs.respond_to? :list_insights + @list_insights = ::Gapic::Config::Method.new list_insights_config + get_insight_config = parent_rpcs.get_insight if parent_rpcs.respond_to? :get_insight + @get_insight = ::Gapic::Config::Method.new get_insight_config + mark_insight_accepted_config = parent_rpcs.mark_insight_accepted if parent_rpcs.respond_to? :mark_insight_accepted + @mark_insight_accepted = ::Gapic::Config::Method.new mark_insight_accepted_config + list_recommendations_config = parent_rpcs.list_recommendations if parent_rpcs.respond_to? :list_recommendations + @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config + get_recommendation_config = parent_rpcs.get_recommendation if parent_rpcs.respond_to? :get_recommendation + @get_recommendation = ::Gapic::Config::Method.new get_recommendation_config + mark_recommendation_dismissed_config = parent_rpcs.mark_recommendation_dismissed if parent_rpcs.respond_to? :mark_recommendation_dismissed + @mark_recommendation_dismissed = ::Gapic::Config::Method.new mark_recommendation_dismissed_config + mark_recommendation_claimed_config = parent_rpcs.mark_recommendation_claimed if parent_rpcs.respond_to? :mark_recommendation_claimed + @mark_recommendation_claimed = ::Gapic::Config::Method.new mark_recommendation_claimed_config + mark_recommendation_succeeded_config = parent_rpcs.mark_recommendation_succeeded if parent_rpcs.respond_to? :mark_recommendation_succeeded + @mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config + mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed + @mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config + get_recommender_config_config = parent_rpcs.get_recommender_config if parent_rpcs.respond_to? :get_recommender_config + @get_recommender_config = ::Gapic::Config::Method.new get_recommender_config_config + update_recommender_config_config = parent_rpcs.update_recommender_config if parent_rpcs.respond_to? :update_recommender_config + @update_recommender_config = ::Gapic::Config::Method.new update_recommender_config_config + get_insight_type_config_config = parent_rpcs.get_insight_type_config if parent_rpcs.respond_to? :get_insight_type_config + @get_insight_type_config = ::Gapic::Config::Method.new get_insight_type_config_config + update_insight_type_config_config = parent_rpcs.update_insight_type_config if parent_rpcs.respond_to? :update_insight_type_config + @update_insight_type_config = ::Gapic::Config::Method.new update_insight_type_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb new file mode 100644 index 000000000000..a82f3ae1664b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb @@ -0,0 +1,1145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/recommender/v1/recommender_service_pb" + +module Google + module Cloud + module Recommender + module V1 + module Recommender + module Rest + ## + # REST service stub for the Recommender 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_insights REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::ListInsightsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::ListInsightsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::ListInsightsResponse] + # A result object deserialized from the server's reply + def list_insights request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_insights_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_insights", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::ListInsightsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_insight REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # A result object deserialized from the server's reply + def get_insight request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_insight_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_insight", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Insight.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mark_insight_accepted REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Insight] + # A result object deserialized from the server's reply + def mark_insight_accepted request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mark_insight_accepted_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mark_insight_accepted", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Insight.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_recommendations REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::ListRecommendationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::ListRecommendationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::ListRecommendationsResponse] + # A result object deserialized from the server's reply + def list_recommendations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_recommendations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_recommendations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_recommendation REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommendationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # A result object deserialized from the server's reply + def get_recommendation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_recommendation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_recommendation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mark_recommendation_dismissed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # A result object deserialized from the server's reply + def mark_recommendation_dismissed request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_dismissed_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mark_recommendation_dismissed", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mark_recommendation_claimed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # A result object deserialized from the server's reply + def mark_recommendation_claimed request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_claimed_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mark_recommendation_claimed", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mark_recommendation_succeeded REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # A result object deserialized from the server's reply + def mark_recommendation_succeeded request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_succeeded_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mark_recommendation_succeeded", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the mark_recommendation_failed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::Recommendation] + # A result object deserialized from the server's reply + def mark_recommendation_failed request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_failed_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "mark_recommendation_failed", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_recommender_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # A result object deserialized from the server's reply + def get_recommender_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_recommender_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_recommender_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::RecommenderConfig.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_recommender_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # A result object deserialized from the server's reply + def update_recommender_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_recommender_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_recommender_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::RecommenderConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_insight_type_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # A result object deserialized from the server's reply + def get_insight_type_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_insight_type_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_insight_type_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.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_insight_type_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # A result object deserialized from the server's reply + def update_insight_type_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_insight_type_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_insight_type_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.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_insights REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::ListInsightsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_insights_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/insights", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/insights", + matches: [ + ["parent", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/insights", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/insights", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_insight REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_insight_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mark_insight_accepted REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mark_insight_accepted_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markAccepted", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markAccepted", + body: "*", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markAccepted", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markAccepted", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_recommendations REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::ListRecommendationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_recommendations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/recommendations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/recommendations", + matches: [ + ["parent", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/recommendations", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/recommendations", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_recommendation REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommendationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_recommendation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mark_recommendation_dismissed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mark_recommendation_dismissed_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markDismissed", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markDismissed", + body: "*", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markDismissed", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markDismissed", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mark_recommendation_claimed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mark_recommendation_claimed_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markClaimed", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markClaimed", + body: "*", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markClaimed", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markClaimed", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mark_recommendation_succeeded REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mark_recommendation_succeeded_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markSucceeded", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markSucceeded", + body: "*", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markSucceeded", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markSucceeded", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the mark_recommendation_failed REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_mark_recommendation_failed_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markFailed", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markFailed", + body: "*", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markFailed", + body: "*", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:markFailed", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_recommender_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_recommender_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_recommender_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest] + # 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_recommender_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{recommender_config.name}", + body: "recommender_config", + matches: [ + ["recommender_config.name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{recommender_config.name}", + body: "recommender_config", + matches: [ + ["recommender_config.name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{recommender_config.name}", + body: "recommender_config", + matches: [ + ["recommender_config.name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_insight_type_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_insight_type_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_insight_type_config REST call + # + # @param request_pb [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest] + # 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_insight_type_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{insight_type_config.name}", + body: "insight_type_config", + matches: [ + ["insight_type_config.name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{insight_type_config.name}", + body: "insight_type_config", + matches: [ + ["insight_type_config.name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{insight_type_config.name}", + body: "insight_type_config", + matches: [ + ["insight_type_config.name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb new file mode 100644 index 000000000000..a718b4c37839 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommender/v1/recommender_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/recommender/v1/recommender_config.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xad\x05\n\x11RecommenderConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12_\n\x1drecommender_generation_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.recommender.v1.RecommenderGenerationConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0brevision_id\x18\x05 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x06 \x03(\x0b\x32?.google.cloud.recommender.v1.RecommenderConfig.AnnotationsEntry\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xac\x02\xea\x41\xa8\x02\n,recommender.googleapis.com/RecommenderConfig\x12Iprojects/{project}/locations/{location}/recommenders/{recommender}/config\x12Sorganizations/{organization}/locations/{location}/recommenders/{recommender}/config\x12XbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config\"F\n\x1bRecommenderGenerationConfig\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\xa3\x01\n\x1f\x63om.google.cloud.recommender.v1B\x16RecommenderConfigProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.Struct", "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 Recommender + module V1 + RecommenderConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommenderConfig").msgclass + RecommenderGenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommenderGenerationConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb new file mode 100644 index 000000000000..77791d6394ea --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/recommender/v1/recommender_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/recommender/v1/insight_pb' +require 'google/cloud/recommender/v1/insight_type_config_pb' +require 'google/cloud/recommender/v1/recommendation_pb' +require 'google/cloud/recommender/v1/recommender_config_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n5google/cloud/recommender/v1/recommender_service.proto\x12\x1bgoogle.cloud.recommender.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/recommender/v1/insight.proto\x1a\x35google/cloud/recommender/v1/insight_type_config.proto\x1a\x30google/cloud/recommender/v1/recommendation.proto\x1a\x34google/cloud/recommender/v1/recommender_config.proto\x1a google/protobuf/field_mask.proto\"\x9b\x01\n\x13ListInsightsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recommender.googleapis.com/InsightType\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\"g\n\x14ListInsightsResponse\x12\x36\n\x08insights\x18\x01 \x03(\x0b\x32$.google.cloud.recommender.v1.Insight\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"M\n\x11GetInsightRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"recommender.googleapis.com/Insight\"\x88\x02\n\x1aMarkInsightAcceptedRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"recommender.googleapis.com/Insight\x12g\n\x0estate_metadata\x18\x02 \x03(\x0b\x32J.google.cloud.recommender.v1.MarkInsightAcceptedRequest.StateMetadataEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9d\x01\n\x1aListRecommendationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recommender.googleapis.com/Recommender\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\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"|\n\x1bListRecommendationsResponse\x12\x44\n\x0frecommendations\x18\x01 \x03(\x0b\x32+.google.cloud.recommender.v1.Recommendation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x18GetRecommendationRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\"s\n\"MarkRecommendationDismissedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"\x96\x02\n MarkRecommendationClaimedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12h\n\x0estate_metadata\x18\x02 \x03(\x0b\x32P.google.cloud.recommender.v1.MarkRecommendationClaimedRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x02\n\"MarkRecommendationSucceededRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12j\n\x0estate_metadata\x18\x02 \x03(\x0b\x32R.google.cloud.recommender.v1.MarkRecommendationSucceededRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x02\n\x1fMarkRecommendationFailedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12g\n\x0estate_metadata\x18\x02 \x03(\x0b\x32O.google.cloud.recommender.v1.MarkRecommendationFailedRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"a\n\x1bGetRecommenderConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,recommender.googleapis.com/RecommenderConfig\"\xb9\x01\n\x1eUpdateRecommenderConfigRequest\x12O\n\x12recommender_config\x18\x01 \x01(\x0b\x32..google.cloud.recommender.v1.RecommenderConfigB\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\"a\n\x1bGetInsightTypeConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,recommender.googleapis.com/InsightTypeConfig\"\xba\x01\n\x1eUpdateInsightTypeConfigRequest\x12P\n\x13insight_type_config\x18\x01 \x01(\x0b\x32..google.cloud.recommender.v1.InsightTypeConfigB\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\x32\xd6.\n\x0bRecommender\x12\x8b\x03\n\x0cListInsights\x12\x30.google.cloud.recommender.v1.ListInsightsRequest\x1a\x31.google.cloud.recommender.v1.ListInsightsResponse\"\x95\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x85\x02\x12;/v1/{parent=projects/*/locations/*/insightTypes/*}/insightsZD\x12\x42/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insightsZ<\x12:/v1/{parent=folders/*/locations/*/insightTypes/*}/insightsZB\x12@/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights\x12\xf8\x02\n\nGetInsight\x12..google.cloud.recommender.v1.GetInsightRequest\x1a$.google.cloud.recommender.v1.Insight\"\x93\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x85\x02\x12;/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}ZD\x12\x42/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}Z<\x12:/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}ZB\x12@/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}\x12\xde\x03\n\x13MarkInsightAccepted\x12\x37.google.cloud.recommender.v1.MarkInsightAcceptedRequest\x1a$.google.cloud.recommender.v1.Insight\"\xe7\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xc5\x02\"H/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZT\"O/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZL\"G/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZR\"M/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*\x12\xcc\x03\n\x13ListRecommendations\x12\x37.google.cloud.recommender.v1.ListRecommendationsRequest\x1a\x38.google.cloud.recommender.v1.ListRecommendationsResponse\"\xc1\x02\xda\x41\x06parent\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02\xa1\x02\x12\x42/v1/{parent=projects/*/locations/*/recommenders/*}/recommendationsZK\x12I/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendationsZC\x12\x41/v1/{parent=folders/*/locations/*/recommenders/*}/recommendationsZI\x12G/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations\x12\xa9\x03\n\x11GetRecommendation\x12\x35.google.cloud.recommender.v1.GetRecommendationRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xaf\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa1\x02\x12\x42/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}ZK\x12I/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}ZC\x12\x41/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}ZI\x12G/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}\x12\xfa\x03\n\x1bMarkRecommendationDismissed\x12?.google.cloud.recommender.v1.MarkRecommendationDismissedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xec\x02\x82\xd3\xe4\x93\x02\xe5\x02\"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*Z\\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*ZT\"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*ZZ\"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*\x12\x89\x04\n\x19MarkRecommendationClaimed\x12=.google.cloud.recommender.v1.MarkRecommendationClaimedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xff\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xdd\x02\"N/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZZ\"U/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZR\"M/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZX\"S/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*\x12\x95\x04\n\x1bMarkRecommendationSucceeded\x12?.google.cloud.recommender.v1.MarkRecommendationSucceededRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\x87\x03\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xe5\x02\"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*Z\\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*ZT\"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*ZZ\"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*\x12\x83\x04\n\x18MarkRecommendationFailed\x12<.google.cloud.recommender.v1.MarkRecommendationFailedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xfb\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xd9\x02\"M/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZY\"T/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZQ\"L/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZW\"R/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*\x12\xcc\x02\n\x14GetRecommenderConfig\x12\x38.google.cloud.recommender.v1.GetRecommenderConfigRequest\x1a..google.cloud.recommender.v1.RecommenderConfig\"\xc9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbb\x01\x12\x37/v1/{name=projects/*/locations/*/recommenders/*/config}Z>\x12/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}\x12\xe1\x03\n\x17UpdateRecommenderConfig\x12;.google.cloud.recommender.v1.UpdateRecommenderConfigRequest\x1a..google.cloud.recommender.v1.RecommenderConfig\"\xd8\x02\xda\x41\x1erecommender_config,update_mask\x82\xd3\xe4\x93\x02\xb0\x02\x32J/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}:\x12recommender_configZe2O/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}:\x12recommender_configZg2Q/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}:\x12recommender_config\x12\xcc\x02\n\x14GetInsightTypeConfig\x12\x38.google.cloud.recommender.v1.GetInsightTypeConfigRequest\x1a..google.cloud.recommender.v1.InsightTypeConfig\"\xc9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbb\x01\x12\x37/v1/{name=projects/*/locations/*/insightTypes/*/config}Z>\x12/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}\x12\xe8\x03\n\x17UpdateInsightTypeConfig\x12;.google.cloud.recommender.v1.UpdateInsightTypeConfigRequest\x1a..google.cloud.recommender.v1.InsightTypeConfig\"\xdf\x02\xda\x41\x1finsight_type_config,update_mask\x82\xd3\xe4\x93\x02\xb6\x02\x32K/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}:\x13insight_type_configZg2P/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}:\x13insight_type_configZi2R/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}:\x13insight_type_config\x1aN\xca\x41\x1arecommender.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9d\x01\n\x1f\x63om.google.cloud.recommender.v1B\x10RecommenderProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.recommender.v1.Insight", "google/cloud/recommender/v1/insight.proto"], + ["google.cloud.recommender.v1.Recommendation", "google/cloud/recommender/v1/recommendation.proto"], + ["google.cloud.recommender.v1.RecommenderConfig", "google/cloud/recommender/v1/recommender_config.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.recommender.v1.InsightTypeConfig", "google/cloud/recommender/v1/insight_type_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 Recommender + module V1 + ListInsightsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsRequest").msgclass + ListInsightsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsResponse").msgclass + GetInsightRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetInsightRequest").msgclass + MarkInsightAcceptedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkInsightAcceptedRequest").msgclass + ListRecommendationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsRequest").msgclass + ListRecommendationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsResponse").msgclass + GetRecommendationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetRecommendationRequest").msgclass + MarkRecommendationDismissedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationDismissedRequest").msgclass + MarkRecommendationClaimedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationClaimedRequest").msgclass + MarkRecommendationSucceededRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationSucceededRequest").msgclass + MarkRecommendationFailedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationFailedRequest").msgclass + GetRecommenderConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetRecommenderConfigRequest").msgclass + UpdateRecommenderConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.UpdateRecommenderConfigRequest").msgclass + GetInsightTypeConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetInsightTypeConfigRequest").msgclass + UpdateInsightTypeConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.UpdateInsightTypeConfigRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb new file mode 100644 index 000000000000..d206d50c37f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb @@ -0,0 +1,122 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/recommender/v1/recommender_service.proto for package 'google.cloud.recommender.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/recommender/v1/recommender_service_pb' + +module Google + module Cloud + module Recommender + module V1 + module Recommender + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.recommender.v1.Recommender' + + # Lists insights for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified insight type. + rpc :ListInsights, ::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Google::Cloud::Recommender::V1::ListInsightsResponse + # Gets the requested insight. Requires the recommender.*.get IAM permission + # for the specified insight type. + rpc :GetInsight, ::Google::Cloud::Recommender::V1::GetInsightRequest, ::Google::Cloud::Recommender::V1::Insight + # Marks the Insight State as Accepted. Users can use this method to + # indicate to the Recommender API that they have applied some action based + # on the insight. This stops the insight content from being updated. + # + # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + # the recommender.*.update IAM permission for the specified insight. + rpc :MarkInsightAccepted, ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Google::Cloud::Recommender::V1::Insight + # Lists recommendations for the specified Cloud Resource. Requires the + # recommender.*.list IAM permission for the specified recommender. + rpc :ListRecommendations, ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Google::Cloud::Recommender::V1::ListRecommendationsResponse + # Gets the requested recommendation. Requires the recommender.*.get + # IAM permission for the specified recommender. + rpc :GetRecommendation, ::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Google::Cloud::Recommender::V1::Recommendation + # Mark the Recommendation State as Dismissed. Users can use this method to + # indicate to the Recommender API that an ACTIVE recommendation has to + # be marked back as DISMISSED. + # + # MarkRecommendationDismissed can be applied to recommendations in ACTIVE + # state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + rpc :MarkRecommendationDismissed, ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Google::Cloud::Recommender::V1::Recommendation + # Marks the Recommendation State as Claimed. Users can use this method to + # indicate to the Recommender API that they are starting to apply the + # recommendation themselves. This stops the recommendation content from being + # updated. Associated insights are frozen and placed in the ACCEPTED state. + # + # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + # SUCCEEDED, FAILED, or ACTIVE state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + rpc :MarkRecommendationClaimed, ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Google::Cloud::Recommender::V1::Recommendation + # Marks the Recommendation State as Succeeded. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation was successful. This stops the recommendation + # content from being updated. Associated insights are frozen and placed in + # the ACCEPTED state. + # + # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + rpc :MarkRecommendationSucceeded, ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Google::Cloud::Recommender::V1::Recommendation + # Marks the Recommendation State as Failed. Users can use this method to + # indicate to the Recommender API that they have applied the recommendation + # themselves, and the operation failed. This stops the recommendation content + # from being updated. Associated insights are frozen and placed in the + # ACCEPTED state. + # + # MarkRecommendationFailed can be applied to recommendations in ACTIVE, + # CLAIMED, SUCCEEDED, or FAILED state. + # + # Requires the recommender.*.update IAM permission for the specified + # recommender. + rpc :MarkRecommendationFailed, ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Google::Cloud::Recommender::V1::Recommendation + # Gets the requested Recommender Config. There is only one instance of the + # config for each Recommender. + rpc :GetRecommenderConfig, ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Google::Cloud::Recommender::V1::RecommenderConfig + # Updates a Recommender Config. This will create a new revision of the + # config. + rpc :UpdateRecommenderConfig, ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Google::Cloud::Recommender::V1::RecommenderConfig + # Gets the requested InsightTypeConfig. There is only one instance of the + # config for each InsightType. + rpc :GetInsightTypeConfig, ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Google::Cloud::Recommender::V1::InsightTypeConfig + # Updates an InsightTypeConfig change. This will create a new revision of the + # config. + rpc :UpdateInsightTypeConfig, ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Google::Cloud::Recommender::V1::InsightTypeConfig + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb new file mode 100644 index 000000000000..a4ce8867fabd --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/recommender/v1/recommender/rest" +require "google/cloud/recommender/v1/version" + +module Google + module Cloud + module Recommender + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/recommender/v1/rest" + # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb new file mode 100644 index 000000000000..43f0a0e7df27 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/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 Recommender + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md new file mode 100644 index 000000000000..32f98e203c92 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Recommender 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-recommender-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb new file mode 100644 index 000000000000..faab3cdb52fd --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + # An insight along with the information used to derive the insight. The insight + # may have associated recommendations as well. + # @!attribute [rw] name + # @return [::String] + # Name of the insight. + # @!attribute [rw] description + # @return [::String] + # Free-form human readable summary in English. The maximum length is 500 + # characters. + # @!attribute [rw] target_resources + # @return [::Array<::String>] + # Fully qualified resource names that this insight is targeting. + # @!attribute [rw] insight_subtype + # @return [::String] + # Insight subtype. Insight content schema will be stable for a given subtype. + # @!attribute [rw] content + # @return [::Google::Protobuf::Struct] + # A struct of custom fields to explain the insight. + # Example: "grantedPermissionsCount": "1000" + # @!attribute [rw] last_refresh_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of the latest data used to generate the insight. + # @!attribute [rw] observation_period + # @return [::Google::Protobuf::Duration] + # Observation period that led to the insight. The source data used to + # generate the insight ends at last_refresh_time and begins at + # (last_refresh_time - observation_period). + # @!attribute [rw] state_info + # @return [::Google::Cloud::Recommender::V1::InsightStateInfo] + # Information state and metadata. + # @!attribute [rw] category + # @return [::Google::Cloud::Recommender::V1::Insight::Category] + # Category being targeted by the insight. + # @!attribute [rw] severity + # @return [::Google::Cloud::Recommender::V1::Insight::Severity] + # Insight's severity. + # @!attribute [rw] etag + # @return [::String] + # Fingerprint of the Insight. Provides optimistic locking when updating + # states. + # @!attribute [rw] associated_recommendations + # @return [::Array<::Google::Cloud::Recommender::V1::Insight::RecommendationReference>] + # Recommendations derived from this insight. + class Insight + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reference to an associated recommendation. + # @!attribute [rw] recommendation + # @return [::String] + # Recommendation resource name, e.g. + # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + class RecommendationReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Insight category. + module Category + # Unspecified category. + CATEGORY_UNSPECIFIED = 0 + + # The insight is related to cost. + COST = 1 + + # The insight is related to security. + SECURITY = 2 + + # The insight is related to performance. + PERFORMANCE = 3 + + # This insight is related to manageability. + MANAGEABILITY = 4 + + # The insight is related to sustainability. + SUSTAINABILITY = 5 + + # This insight is related to reliability. + RELIABILITY = 6 + end + + # Insight severity levels. + module Severity + # Insight has unspecified severity. + SEVERITY_UNSPECIFIED = 0 + + # Insight has low severity. + LOW = 1 + + # Insight has medium severity. + MEDIUM = 2 + + # Insight has high severity. + HIGH = 3 + + # Insight has critical severity. + CRITICAL = 4 + end + end + + # Information related to insight state. + # @!attribute [rw] state + # @return [::Google::Cloud::Recommender::V1::InsightStateInfo::State] + # Insight state. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of metadata for the state, provided by user or automations systems. + class InsightStateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents insight state. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # Insight is active. Content for ACTIVE insights can be updated by Google. + # ACTIVE insights can be marked DISMISSED OR ACCEPTED. + ACTIVE = 1 + + # Some action has been taken based on this insight. Insights become + # accepted when a recommendation derived from the insight has been marked + # CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked + # ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED + # insights can only be marked ACCEPTED (which may update state metadata). + ACCEPTED = 2 + + # Insight is dismissed. Content for DISMISSED insights can be updated by + # Google. DISMISSED insights can be marked as ACTIVE. + DISMISSED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb new file mode 100644 index 000000000000..b75f495146df --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + # Configuration for an InsightType. + # @!attribute [rw] name + # @return [::String] + # Name of insight type config. + # Eg, + # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config + # @!attribute [rw] insight_type_generation_config + # @return [::Google::Cloud::Recommender::V1::InsightTypeGenerationConfig] + # InsightTypeGenerationConfig which configures the generation of + # insights for this insight type. + # @!attribute [rw] etag + # @return [::String] + # Fingerprint of the InsightTypeConfig. Provides optimistic locking when + # updating. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Last time when the config was updated. + # @!attribute [r] revision_id + # @return [::String] + # Output only. Immutable. The revision ID of the config. + # A new revision is committed whenever the config is changed in any way. + # The format is an 8-character hexadecimal string. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows clients to store small amounts of arbitrary data. Annotations must + # follow the Kubernetes syntax. + # The total size of all keys and values combined is limited to 256k. + # Key can have 2 segments: prefix (optional) and name (required), + # separated by a slash (/). + # Prefix must be a DNS subdomain. + # Name must be 63 characters or less, begin and end with alphanumerics, + # with dashes (-), underscores (_), dots (.), and alphanumerics between. + # @!attribute [rw] display_name + # @return [::String] + # A user-settable field to provide a human-readable name to be used in user + # interfaces. + class InsightTypeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A configuration to customize the generation of insights. + # Eg, customizing the lookback period considered when generating a + # insight. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameters for this InsightTypeGenerationConfig. These configs can be used + # by or are applied to all subtypes. + class InsightTypeGenerationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb new file mode 100644 index 000000000000..86f8e1e47b4d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + # A recommendation along with a suggested action. E.g., a rightsizing + # recommendation for an underutilized VM, IAM role recommendations, etc + # @!attribute [rw] name + # @return [::String] + # Name of recommendation. + # @!attribute [rw] description + # @return [::String] + # Free-form human readable summary in English. The maximum length is 500 + # characters. + # @!attribute [rw] recommender_subtype + # @return [::String] + # Contains an identifier for a subtype of recommendations produced for the + # same recommender. Subtype is a function of content and impact, meaning a + # new subtype might be added when significant changes to `content` or + # `primary_impact.category` are introduced. See the Recommenders section + # to see a list of subtypes for a given Recommender. + # + # Examples: + # For recommender = "google.iam.policy.Recommender", + # recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + # @!attribute [rw] last_refresh_time + # @return [::Google::Protobuf::Timestamp] + # Last time this recommendation was refreshed by the system that created it + # in the first place. + # @!attribute [rw] primary_impact + # @return [::Google::Cloud::Recommender::V1::Impact] + # The primary impact that this recommendation can have while trying to + # optimize for one category. + # @!attribute [rw] additional_impact + # @return [::Array<::Google::Cloud::Recommender::V1::Impact>] + # Optional set of additional impact that this recommendation may have when + # trying to optimize for the primary category. These may be positive + # or negative. + # @!attribute [rw] priority + # @return [::Google::Cloud::Recommender::V1::Recommendation::Priority] + # Recommendation's priority. + # @!attribute [rw] content + # @return [::Google::Cloud::Recommender::V1::RecommendationContent] + # Content of the recommendation describing recommended changes to resources. + # @!attribute [rw] state_info + # @return [::Google::Cloud::Recommender::V1::RecommendationStateInfo] + # Information for state. Contains state and metadata. + # @!attribute [rw] etag + # @return [::String] + # Fingerprint of the Recommendation. Provides optimistic locking when + # updating states. + # @!attribute [rw] associated_insights + # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation::InsightReference>] + # Insights that led to this recommendation. + # @!attribute [rw] xor_group_id + # @return [::String] + # Corresponds to a mutually exclusive group ID within a recommender. + # A non-empty ID indicates that the recommendation belongs to a mutually + # exclusive group. This means that only one recommendation within the group + # is suggested to be applied. + class Recommendation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reference to an associated insight. + # @!attribute [rw] insight + # @return [::String] + # Insight resource name, e.g. + # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + class InsightReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Recommendation priority levels. + module Priority + # Recommendation has unspecified priority. + PRIORITY_UNSPECIFIED = 0 + + # Recommendation has P4 priority (lowest priority). + P4 = 1 + + # Recommendation has P3 priority (second lowest priority). + P3 = 2 + + # Recommendation has P2 priority (second highest priority). + P2 = 3 + + # Recommendation has P1 priority (highest priority). + P1 = 4 + end + end + + # Contains what resources are changing and how they are changing. + # @!attribute [rw] operation_groups + # @return [::Array<::Google::Cloud::Recommender::V1::OperationGroup>] + # Operations to one or more Google Cloud resources grouped in such a way + # that, all operations within one group are expected to be performed + # atomically and in an order. + # @!attribute [rw] overview + # @return [::Google::Protobuf::Struct] + # Condensed overview information about the recommendation. + class RecommendationContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Group of operations that need to be performed atomically. + # @!attribute [rw] operations + # @return [::Array<::Google::Cloud::Recommender::V1::Operation>] + # List of operations across one or more resources that belong to this group. + # Loosely based on RFC6902 and should be performed in the order they appear. + class OperationGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains an operation for a resource loosely based on the JSON-PATCH format + # with support for: + # + # * Custom filters for describing partial array patch. + # * Extended path values for describing nested arrays. + # * Custom fields for describing the resource for which the operation is being + # described. + # * Allows extension to custom operations not natively supported by RFC6902. + # See https://tools.ietf.org/html/rfc6902 for details on the original RFC. + # @!attribute [rw] action + # @return [::String] + # Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', + # 'copy', 'test' and custom operations. This field is case-insensitive and + # always populated. + # @!attribute [rw] resource_type + # @return [::String] + # Type of GCP resource being modified/tested. This field is always populated. + # Example: cloudresourcemanager.googleapis.com/Project, + # compute.googleapis.com/Instance + # @!attribute [rw] resource + # @return [::String] + # Contains the fully qualified resource name. This field is always populated. + # ex: //cloudresourcemanager.googleapis.com/projects/foo. + # @!attribute [rw] path + # @return [::String] + # Path to the target field being operated on. If the operation is at the + # resource level, then path should be "/". This field is always populated. + # @!attribute [rw] source_resource + # @return [::String] + # Can be set with action 'copy' to copy resource configuration across + # different resources of the same type. Example: A resource clone can be + # done via action = 'copy', path = "/", from = "/", + # source_resource = and resource_name = . + # This field is empty for all other values of `action`. + # @!attribute [rw] source_path + # @return [::String] + # Can be set with action 'copy' or 'move' to indicate the source field within + # resource or source_resource, ignored if provided for other operation types. + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + # Value for the `path` field. Will be set for actions:'add'/'replace'. + # Maybe set for action: 'test'. Either this or `value_matcher` will be set + # for 'test' operation. An exact match must be performed. + # + # Note: The following fields are mutually exclusive: `value`, `value_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] value_matcher + # @return [::Google::Cloud::Recommender::V1::ValueMatcher] + # Can be set for action 'test' for advanced matching for the value of + # 'path' field. Either this or `value` will be set for 'test' operation. + # + # Note: The following fields are mutually exclusive: `value_matcher`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] path_filters + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Set of filters to apply if `path` refers to array elements or nested array + # elements in order to narrow down to a single unique element that is being + # tested/modified. + # This is intended to be an exact match per filter. To perform advanced + # matching, use path_value_matchers. + # + # * Example: + # ``` + # { + # "/versions/*/name" : "it-123" + # "/versions/*/targetSize/percent": 20 + # } + # ``` + # * Example: + # ``` + # { + # "/bindings/*/role": "roles/owner" + # "/bindings/*/condition" : null + # } + # ``` + # * Example: + # ``` + # { + # "/bindings/*/role": "roles/owner" + # "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + # } + # ``` + # When both path_filters and path_value_matchers are set, an implicit AND + # must be performed. + # @!attribute [rw] path_value_matchers + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Recommender::V1::ValueMatcher}] + # Similar to path_filters, this contains set of filters to apply if `path` + # field refers to array elements. This is meant to support value matching + # beyond exact match. To perform exact match, use path_filters. + # When both path_filters and path_value_matchers are set, an implicit AND + # must be performed. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class PathFiltersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Recommender::V1::ValueMatcher] + class PathValueMatchersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains various matching options for values for a GCP resource field. + # @!attribute [rw] matches_pattern + # @return [::String] + # To be used for full regex matching. The regular expression is using the + # Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be + # used with RE2::FullMatch + class ValueMatcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains metadata about how much money a recommendation can save or incur. + # @!attribute [rw] cost + # @return [::Google::Type::Money] + # An approximate projection on amount saved or amount incurred. Negative cost + # units indicate cost savings and positive cost units indicate increase. + # See google.type.Money documentation for positive/negative units. + # + # A user's permissions may affect whether the cost is computed using list + # prices or custom contract prices. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration for which this cost applies. + # @!attribute [rw] cost_in_local_currency + # @return [::Google::Type::Money] + # The approximate cost savings in the billing account's local currency. + class CostProjection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains various ways of describing the impact on Security. + # @!attribute [rw] details + # @return [::Google::Protobuf::Struct] + # Additional security impact details that is provided by the recommender. + class SecurityProjection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains metadata about how much sustainability a recommendation can save or + # incur. + # @!attribute [rw] kg_c_o2e + # @return [::Float] + # Carbon Footprint generated in kg of CO2 equivalent. + # Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration for which this sustainability applies. + class SustainabilityProjection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information on the impact of a reliability recommendation. + # @!attribute [rw] risks + # @return [::Array<::Google::Cloud::Recommender::V1::ReliabilityProjection::RiskType>] + # Reliability risks mitigated by this recommendation. + # @!attribute [rw] details + # @return [::Google::Protobuf::Struct] + # Per-recommender projection. + class ReliabilityProjection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The risk associated with the reliability issue. + module RiskType + # Default unspecified risk. Don't use directly. + RISK_TYPE_UNSPECIFIED = 0 + + # Potential service downtime. + SERVICE_DISRUPTION = 1 + + # Potential data loss. + DATA_LOSS = 2 + + # Potential access denial. The service is still up but some or all clients + # can't access it. + ACCESS_DENY = 3 + end + end + + # Contains the impact a recommendation can have for a given category. + # @!attribute [rw] category + # @return [::Google::Cloud::Recommender::V1::Impact::Category] + # Category that is being targeted. + # @!attribute [rw] cost_projection + # @return [::Google::Cloud::Recommender::V1::CostProjection] + # Use with CategoryType.COST + # + # Note: The following fields are mutually exclusive: `cost_projection`, `security_projection`, `sustainability_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] security_projection + # @return [::Google::Cloud::Recommender::V1::SecurityProjection] + # Use with CategoryType.SECURITY + # + # Note: The following fields are mutually exclusive: `security_projection`, `cost_projection`, `sustainability_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sustainability_projection + # @return [::Google::Cloud::Recommender::V1::SustainabilityProjection] + # Use with CategoryType.SUSTAINABILITY + # + # Note: The following fields are mutually exclusive: `sustainability_projection`, `cost_projection`, `security_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reliability_projection + # @return [::Google::Cloud::Recommender::V1::ReliabilityProjection] + # Use with CategoryType.RELIABILITY + # + # Note: The following fields are mutually exclusive: `reliability_projection`, `cost_projection`, `security_projection`, `sustainability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Impact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The category of the impact. + module Category + # Default unspecified category. Don't use directly. + CATEGORY_UNSPECIFIED = 0 + + # Indicates a potential increase or decrease in cost. + COST = 1 + + # Indicates a potential increase or decrease in security. + SECURITY = 2 + + # Indicates a potential increase or decrease in performance. + PERFORMANCE = 3 + + # Indicates a potential increase or decrease in manageability. + MANAGEABILITY = 4 + + # Indicates a potential increase or decrease in sustainability. + SUSTAINABILITY = 5 + + # Indicates a potential increase or decrease in reliability. + RELIABILITY = 6 + end + end + + # Information for state. Contains state and metadata. + # @!attribute [rw] state + # @return [::Google::Cloud::Recommender::V1::RecommendationStateInfo::State] + # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of metadata for the state, provided by user or automations systems. + class RecommendationStateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents Recommendation State. + module State + # Default state. Don't use directly. + STATE_UNSPECIFIED = 0 + + # Recommendation is active and can be applied. Recommendations content can + # be updated by Google. + # + # ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + ACTIVE = 1 + + # Recommendation is in claimed state. Recommendations content is + # immutable and cannot be updated by Google. + # + # CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + CLAIMED = 6 + + # Recommendation is in succeeded state. Recommendations content is + # immutable and cannot be updated by Google. + # + # SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. + SUCCEEDED = 3 + + # Recommendation is in failed state. Recommendations content is immutable + # and cannot be updated by Google. + # + # FAILED recommendations can be marked as SUCCEEDED, or FAILED. + FAILED = 4 + + # Recommendation is in dismissed state. Recommendation content can be + # updated by Google. + # + # DISMISSED recommendations can be marked as ACTIVE. + DISMISSED = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb new file mode 100644 index 000000000000..c0dfde01256c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + # Configuration for a Recommender. + # @!attribute [rw] name + # @return [::String] + # Name of recommender config. + # Eg, + # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config + # @!attribute [rw] recommender_generation_config + # @return [::Google::Cloud::Recommender::V1::RecommenderGenerationConfig] + # RecommenderGenerationConfig which configures the Generation of + # recommendations for this recommender. + # @!attribute [rw] etag + # @return [::String] + # Fingerprint of the RecommenderConfig. Provides optimistic locking when + # updating. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Last time when the config was updated. + # @!attribute [r] revision_id + # @return [::String] + # Output only. Immutable. The revision ID of the config. + # A new revision is committed whenever the config is changed in any way. + # The format is an 8-character hexadecimal string. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Allows clients to store small amounts of arbitrary data. Annotations must + # follow the Kubernetes syntax. + # The total size of all keys and values combined is limited to 256k. + # Key can have 2 segments: prefix (optional) and name (required), + # separated by a slash (/). + # Prefix must be a DNS subdomain. + # Name must be 63 characters or less, begin and end with alphanumerics, + # with dashes (-), underscores (_), dots (.), and alphanumerics between. + # @!attribute [rw] display_name + # @return [::String] + # A user-settable field to provide a human-readable name to be used in user + # interfaces. + class RecommenderConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Configuration to customize the generation of recommendations. + # Eg, customizing the lookback period considered when generating a + # recommendation. + # @!attribute [rw] params + # @return [::Google::Protobuf::Struct] + # Parameters for this RecommenderGenerationConfig. These configs can be used + # by or are applied to all subtypes. + class RecommenderGenerationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb new file mode 100644 index 000000000000..bb413762f92f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb @@ -0,0 +1,390 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Recommender + module V1 + # Request for the `ListInsights` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # INSIGHT_TYPE_ID refers to supported insight types: + # https://cloud.google.com/recommender/docs/insights/insight-types. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter expression to restrict the insights returned. Supported + # filter fields: + # + # * `stateInfo.state` + # + # * `insightSubtype` + # + # * `severity` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `insightSubtype = PERMISSIONS_USAGE` + # + # * `severity = CRITICAL OR severity = HIGH` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + class ListInsightsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to the `ListInsights` method. + # @!attribute [rw] insights + # @return [::Array<::Google::Cloud::Recommender::V1::Insight>] + # The set of insights for the `parent` resource. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be used to request the next page of results. This field is + # empty if there are no additional results. + class ListInsightsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to the `GetInsight` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the insight. + class GetInsightRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `MarkInsightAccepted` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the insight. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. State properties user wish to include with this state. Full + # replace of the current state_metadata. + # @!attribute [rw] etag + # @return [::String] + # Required. Fingerprint of the Insight. Provides optimistic locking. + class MarkInsightAcceptedRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the `ListRecommendations` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The container resource on which to execute the request. + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` + # + # LOCATION here refers to GCP Locations: + # https://cloud.google.com/about/locations/ + # RECOMMENDER_ID refers to supported recommenders: + # https://cloud.google.com/recommender/docs/recommenders. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return from this request. + # Non-positive values are ignored. If not specified, the server will + # determine the number of results to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. If present, retrieves the next batch of results from the + # preceding call to this method. `page_token` must be the value of + # `next_page_token` from the previous response. The values of other method + # parameters must be identical to those in the previous call. + # @!attribute [rw] filter + # @return [::String] + # Filter expression to restrict the recommendations returned. Supported + # filter fields: + # + # * `state_info.state` + # + # * `recommenderSubtype` + # + # * `priority` + # + # * `targetResources` + # + # Examples: + # + # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` + # + # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` + # + # * `priority = P1 OR priority = P2` + # + # * `targetResources : + # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` + # + # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` + # + # The max allowed filter length is 500 characters. + # + # (These expressions are based on the filter language described at + # https://google.aip.dev/160) + class ListRecommendationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to the `ListRecommendations` method. + # @!attribute [rw] recommendations + # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation>] + # The set of recommendations for the `parent` resource. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be used to request the next page of results. This field is + # empty if there are no additional results. + class ListRecommendationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to the `GetRecommendation` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the recommendation. + class GetRecommendationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `MarkRecommendationDismissed` Method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the recommendation. + # @!attribute [rw] etag + # @return [::String] + # Fingerprint of the Recommendation. Provides optimistic locking. + class MarkRecommendationDismissedRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `MarkRecommendationClaimed` Method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the recommendation. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @!attribute [rw] etag + # @return [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + class MarkRecommendationClaimedRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the `MarkRecommendationSucceeded` Method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the recommendation. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @!attribute [rw] etag + # @return [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + class MarkRecommendationSucceededRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the `MarkRecommendationFailed` Method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the recommendation. + # @!attribute [rw] state_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # State properties to include with this state. Overwrites any existing + # `state_metadata`. + # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. + # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. + # @!attribute [rw] etag + # @return [::String] + # Required. Fingerprint of the Recommendation. Provides optimistic locking. + class MarkRecommendationFailedRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class StateMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the GetRecommenderConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the Recommendation Config to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` + class GetRecommenderConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `UpdateRecommenderConfig` method. + # @!attribute [rw] recommender_config + # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] + # Required. The RecommenderConfig to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + class UpdateRecommenderConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the GetInsightTypeConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the InsightTypeConfig to get. + # + # Acceptable formats: + # + # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + # + # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` + class GetInsightTypeConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `UpdateInsightTypeConfig` method. + # @!attribute [rw] insight_type_config + # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] + # Required. The InsightTypeConfig to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # If true, validate the request and preview the change, but do not actually + # update it. + class UpdateInsightTypeConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..56a32eee300d --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.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 Type + # Represents an amount of money with its currency type. + # @!attribute [rw] currency_code + # @return [::String] + # The three-letter currency code defined in ISO 4217. + # @!attribute [rw] units + # @return [::Integer] + # The whole units of the amount. + # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + # @!attribute [rw] nanos + # @return [::Integer] + # Number of nano (10^-9) units of the amount. + # The value must be between -999,999,999 and +999,999,999 inclusive. + # If `units` is positive, `nanos` must be positive or zero. + # If `units` is zero, `nanos` can be positive, zero, or negative. + # If `units` is negative, `nanos` must be negative or zero. + # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + class Money + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile new file mode 100644 index 000000000000..18e10c392f62 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender-v1", path: "../" +else + gem "google-cloud-recommender-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-recommender-v1/snippets/recommender/get_insight.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb new file mode 100644 index 000000000000..2cfd5ef432f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_GetInsight_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the get_insight call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_insight. +# +def get_insight + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetInsightRequest.new + + # Call the get_insight method. + result = client.get_insight request + + # The returned object is of type Google::Cloud::Recommender::V1::Insight. + p result +end +# [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb new file mode 100644 index 000000000000..1ced3f4d6e9b --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_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 recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the get_insight_type_config call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config. +# +def get_insight_type_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new + + # Call the get_insight_type_config method. + result = client.get_insight_type_config request + + # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + p result +end +# [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb new file mode 100644 index 000000000000..2eae8783dbe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_GetRecommendation_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the get_recommendation call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation. +# +def get_recommendation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new + + # Call the get_recommendation method. + result = client.get_recommendation request + + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end +# [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb new file mode 100644 index 000000000000..a2878d79cd79 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_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 recommender_v1_generated_Recommender_GetRecommenderConfig_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the get_recommender_config call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config. +# +def get_recommender_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new + + # Call the get_recommender_config method. + result = client.get_recommender_config request + + # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + p result +end +# [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb new file mode 100644 index 000000000000..40a049765449 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.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 recommender_v1_generated_Recommender_ListInsights_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the list_insights call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#list_insights. +# +def list_insights + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::ListInsightsRequest.new + + # Call the list_insights method. + result = client.list_insights request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Recommender::V1::Insight. + p item + end +end +# [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb new file mode 100644 index 000000000000..30a00dc303d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.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 recommender_v1_generated_Recommender_ListRecommendations_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the list_recommendations call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations. +# +def list_recommendations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new + + # Call the list_recommendations method. + result = client.list_recommendations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. + p item + end +end +# [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb new file mode 100644 index 000000000000..54065065a346 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_MarkInsightAccepted_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the mark_insight_accepted call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted. +# +def mark_insight_accepted + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new + + # Call the mark_insight_accepted method. + result = client.mark_insight_accepted request + + # The returned object is of type Google::Cloud::Recommender::V1::Insight. + p result +end +# [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb new file mode 100644 index 000000000000..b535c53f219f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the mark_recommendation_claimed call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed. +# +def mark_recommendation_claimed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new + + # Call the mark_recommendation_claimed method. + result = client.mark_recommendation_claimed request + + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end +# [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb new file mode 100644 index 000000000000..33c84ec4f40a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the mark_recommendation_dismissed call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed. +# +def mark_recommendation_dismissed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new + + # Call the mark_recommendation_dismissed method. + result = client.mark_recommendation_dismissed request + + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end +# [END recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb new file mode 100644 index 000000000000..25f123d2f151 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the mark_recommendation_failed call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed. +# +def mark_recommendation_failed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new + + # Call the mark_recommendation_failed method. + result = client.mark_recommendation_failed request + + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end +# [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb new file mode 100644 index 000000000000..7d3340005fe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the mark_recommendation_succeeded call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded. +# +def mark_recommendation_succeeded + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new + + # Call the mark_recommendation_succeeded method. + result = client.mark_recommendation_succeeded request + + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end +# [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb new file mode 100644 index 000000000000..2f072582bc10 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_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 recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the update_insight_type_config call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config. +# +def update_insight_type_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new + + # Call the update_insight_type_config method. + result = client.update_insight_type_config request + + # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + p result +end +# [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb new file mode 100644 index 000000000000..0b821b23dadc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_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 recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] +require "google/cloud/recommender/v1" + +## +# Snippet for the update_recommender_config call in the Recommender service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config. +# +def update_recommender_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new + + # Call the update_recommender_config method. + result = client.update_recommender_config request + + # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + p result +end +# [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json b/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json new file mode 100644 index 000000000000..6ccb7dda649f --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-recommender-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.recommender.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "recommender_v1_generated_Recommender_ListInsights_sync", + "title": "Snippet for the list_insights call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#list_insights.", + "file": "recommender/list_insights.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_insights", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#list_insights", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::ListInsightsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::ListInsightsResponse", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "ListInsights", + "full_name": "google.cloud.recommender.v1.Recommender.ListInsights", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_GetInsight_sync", + "title": "Snippet for the get_insight call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_insight.", + "file": "recommender/get_insight.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_insight", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_insight", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::GetInsightRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Insight", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "GetInsight", + "full_name": "google.cloud.recommender.v1.Recommender.GetInsight", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_MarkInsightAccepted_sync", + "title": "Snippet for the mark_insight_accepted call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted.", + "file": "recommender/mark_insight_accepted.rb", + "language": "RUBY", + "client_method": { + "short_name": "mark_insight_accepted", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Insight", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "MarkInsightAccepted", + "full_name": "google.cloud.recommender.v1.Recommender.MarkInsightAccepted", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_ListRecommendations_sync", + "title": "Snippet for the list_recommendations call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations.", + "file": "recommender/list_recommendations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_recommendations", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::ListRecommendationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::ListRecommendationsResponse", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "ListRecommendations", + "full_name": "google.cloud.recommender.v1.Recommender.ListRecommendations", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_GetRecommendation_sync", + "title": "Snippet for the get_recommendation call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation.", + "file": "recommender/get_recommendation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_recommendation", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::GetRecommendationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Recommendation", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "GetRecommendation", + "full_name": "google.cloud.recommender.v1.Recommender.GetRecommendation", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync", + "title": "Snippet for the mark_recommendation_dismissed call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed.", + "file": "recommender/mark_recommendation_dismissed.rb", + "language": "RUBY", + "client_method": { + "short_name": "mark_recommendation_dismissed", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Recommendation", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "MarkRecommendationDismissed", + "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationDismissed", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync", + "title": "Snippet for the mark_recommendation_claimed call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed.", + "file": "recommender/mark_recommendation_claimed.rb", + "language": "RUBY", + "client_method": { + "short_name": "mark_recommendation_claimed", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Recommendation", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "MarkRecommendationClaimed", + "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationClaimed", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync", + "title": "Snippet for the mark_recommendation_succeeded call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded.", + "file": "recommender/mark_recommendation_succeeded.rb", + "language": "RUBY", + "client_method": { + "short_name": "mark_recommendation_succeeded", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Recommendation", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "MarkRecommendationSucceeded", + "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationSucceeded", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationFailed_sync", + "title": "Snippet for the mark_recommendation_failed call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed.", + "file": "recommender/mark_recommendation_failed.rb", + "language": "RUBY", + "client_method": { + "short_name": "mark_recommendation_failed", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::Recommendation", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "MarkRecommendationFailed", + "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationFailed", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_GetRecommenderConfig_sync", + "title": "Snippet for the get_recommender_config call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config.", + "file": "recommender/get_recommender_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_recommender_config", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::RecommenderConfig", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "GetRecommenderConfig", + "full_name": "google.cloud.recommender.v1.Recommender.GetRecommenderConfig", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync", + "title": "Snippet for the update_recommender_config call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config.", + "file": "recommender/update_recommender_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_recommender_config", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::RecommenderConfig", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "UpdateRecommenderConfig", + "full_name": "google.cloud.recommender.v1.Recommender.UpdateRecommenderConfig", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_GetInsightTypeConfig_sync", + "title": "Snippet for the get_insight_type_config call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config.", + "file": "recommender/get_insight_type_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_insight_type_config", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::InsightTypeConfig", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "GetInsightTypeConfig", + "full_name": "google.cloud.recommender.v1.Recommender.GetInsightTypeConfig", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync", + "title": "Snippet for the update_insight_type_config call in the Recommender service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config.", + "file": "recommender/update_insight_type_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_insight_type_config", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Recommender::V1::InsightTypeConfig", + "client": { + "short_name": "Recommender::Client", + "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" + }, + "method": { + "short_name": "UpdateInsightTypeConfig", + "full_name": "google.cloud.recommender.v1.Recommender.UpdateInsightTypeConfig", + "service": { + "short_name": "Recommender", + "full_name": "google.cloud.recommender.v1.Recommender" + } + } + }, + "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-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb new file mode 100644 index 000000000000..45c9e076dd5c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommender/v1/recommender" + +class ::Google::Cloud::Recommender::V1::Recommender::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_insight_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.insight_path project: "value0", location: "value1", insight_type: "value2", insight: "value3" + assert_equal "projects/value0/locations/value1/insightTypes/value2/insights/value3", path + + path = client.insight_path billing_account: "value0", location: "value1", insight_type: "value2", insight: "value3" + assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2/insights/value3", path + + path = client.insight_path folder: "value0", location: "value1", insight_type: "value2", insight: "value3" + assert_equal "folders/value0/locations/value1/insightTypes/value2/insights/value3", path + + path = client.insight_path organization: "value0", location: "value1", insight_type: "value2", insight: "value3" + assert_equal "organizations/value0/locations/value1/insightTypes/value2/insights/value3", path + end + end + + def test_insight_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.insight_type_path project: "value0", location: "value1", insight_type: "value2" + assert_equal "projects/value0/locations/value1/insightTypes/value2", path + + path = client.insight_type_path billing_account: "value0", location: "value1", insight_type: "value2" + assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2", path + + path = client.insight_type_path folder: "value0", location: "value1", insight_type: "value2" + assert_equal "folders/value0/locations/value1/insightTypes/value2", path + + path = client.insight_type_path organization: "value0", location: "value1", insight_type: "value2" + assert_equal "organizations/value0/locations/value1/insightTypes/value2", path + end + end + + def test_insight_type_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::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.insight_type_config_path project: "value0", location: "value1", insight_type: "value2" + assert_equal "projects/value0/locations/value1/insightTypes/value2/config", path + + path = client.insight_type_config_path organization: "value0", location: "value1", insight_type: "value2" + assert_equal "organizations/value0/locations/value1/insightTypes/value2/config", path + + path = client.insight_type_config_path billing_account: "value0", location: "value1", insight_type: "value2" + assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2/config", path + end + end + + def test_recommendation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.recommendation_path project: "value0", location: "value1", recommender: "value2", recommendation: "value3" + assert_equal "projects/value0/locations/value1/recommenders/value2/recommendations/value3", path + + path = client.recommendation_path billing_account: "value0", location: "value1", recommender: "value2", recommendation: "value3" + assert_equal "billingAccounts/value0/locations/value1/recommenders/value2/recommendations/value3", path + + path = client.recommendation_path folder: "value0", location: "value1", recommender: "value2", recommendation: "value3" + assert_equal "folders/value0/locations/value1/recommenders/value2/recommendations/value3", path + + path = client.recommendation_path organization: "value0", location: "value1", recommender: "value2", recommendation: "value3" + assert_equal "organizations/value0/locations/value1/recommenders/value2/recommendations/value3", path + end + end + + def test_recommender_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.recommender_path project: "value0", location: "value1", recommender: "value2" + assert_equal "projects/value0/locations/value1/recommenders/value2", path + + path = client.recommender_path billing_account: "value0", location: "value1", recommender: "value2" + assert_equal "billingAccounts/value0/locations/value1/recommenders/value2", path + + path = client.recommender_path folder: "value0", location: "value1", recommender: "value2" + assert_equal "folders/value0/locations/value1/recommenders/value2", path + + path = client.recommender_path organization: "value0", location: "value1", recommender: "value2" + assert_equal "organizations/value0/locations/value1/recommenders/value2", path + end + end + + def test_recommender_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::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.recommender_config_path project: "value0", location: "value1", recommender: "value2" + assert_equal "projects/value0/locations/value1/recommenders/value2/config", path + + path = client.recommender_config_path organization: "value0", location: "value1", recommender: "value2" + assert_equal "organizations/value0/locations/value1/recommenders/value2/config", path + + path = client.recommender_config_path billing_account: "value0", location: "value1", recommender: "value2" + assert_equal "billingAccounts/value0/locations/value1/recommenders/value2/config", path + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb new file mode 100644 index 000000000000..b8d581c7dd1c --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb @@ -0,0 +1,820 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/recommender/v1/recommender_service_pb" +require "google/cloud/recommender/v1/recommender/rest" + + +class ::Google::Cloud::Recommender::V1::Recommender::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_insights + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::ListInsightsResponse.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_insights_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_list_insights_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_insights_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_insights({ 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_insights 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_insights ::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights({ 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_insights(::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights_client_stub.call_count + end + end + end + + def test_get_insight + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Insight.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_insight_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_insight_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_insight_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_insight({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_insight name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_insight ::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_insight({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_insight(::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_insight_client_stub.call_count + end + end + end + + def test_mark_insight_accepted + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Insight.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_insight_accepted_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_insight_accepted_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mark_insight_accepted_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mark_insight_accepted name: name, state_metadata: state_metadata, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mark_insight_accepted ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mark_insight_accepted(::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mark_insight_accepted_client_stub.call_count + end + end + end + + def test_list_recommendations + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.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_recommendations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_list_recommendations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_recommendations_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_recommendations({ 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_recommendations 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_recommendations ::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations({ 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_recommendations(::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations_client_stub.call_count + end + end + end + + def test_get_recommendation + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Recommendation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recommendation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_recommendation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_recommendation_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_recommendation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_recommendation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_recommendation ::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_recommendation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_recommendation(::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_recommendation_client_stub.call_count + end + end + end + + def test_mark_recommendation_dismissed + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Recommendation.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" + + mark_recommendation_dismissed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_dismissed_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mark_recommendation_dismissed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mark_recommendation_dismissed({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mark_recommendation_dismissed name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mark_recommendation_dismissed ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mark_recommendation_dismissed({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mark_recommendation_dismissed(::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mark_recommendation_dismissed_client_stub.call_count + end + end + end + + def test_mark_recommendation_claimed + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Recommendation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_claimed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_claimed_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mark_recommendation_claimed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mark_recommendation_claimed name: name, state_metadata: state_metadata, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mark_recommendation_claimed ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mark_recommendation_claimed(::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mark_recommendation_claimed_client_stub.call_count + end + end + end + + def test_mark_recommendation_succeeded + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Recommendation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_succeeded_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_succeeded_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mark_recommendation_succeeded_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mark_recommendation_succeeded name: name, state_metadata: state_metadata, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mark_recommendation_succeeded ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mark_recommendation_succeeded(::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mark_recommendation_succeeded_client_stub.call_count + end + end + end + + def test_mark_recommendation_failed + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::Recommendation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_failed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_failed_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, mark_recommendation_failed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.mark_recommendation_failed name: name, state_metadata: state_metadata, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.mark_recommendation_failed ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.mark_recommendation_failed(::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, mark_recommendation_failed_client_stub.call_count + end + end + end + + def test_get_recommender_config + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::RecommenderConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recommender_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_recommender_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_recommender_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_recommender_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_recommender_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_recommender_config ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_recommender_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_recommender_config(::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_recommender_config_client_stub.call_count + end + end + end + + def test_update_recommender_config + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::RecommenderConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + recommender_config = {} + update_mask = {} + validate_only = true + + update_recommender_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_update_recommender_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_recommender_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_recommender_config recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_recommender_config ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, 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_recommender_config({ recommender_config: recommender_config, 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_recommender_config(::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, 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_recommender_config_client_stub.call_count + end + end + end + + def test_get_insight_type_config + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_insight_type_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_insight_type_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_insight_type_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_insight_type_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_insight_type_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_insight_type_config ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_insight_type_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_insight_type_config(::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_insight_type_config_client_stub.call_count + end + end + end + + def test_update_insight_type_config + # Create test objects. + client_result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + insight_type_config = {} + update_mask = {} + validate_only = true + + update_insight_type_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_update_insight_type_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_insight_type_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_insight_type_config insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_insight_type_config ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, 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_insight_type_config({ insight_type_config: insight_type_config, 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_insight_type_config(::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, 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_insight_type_config_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Recommender::V1::Recommender::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::Recommender::V1::Recommender::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb new file mode 100644 index 000000000000..c6f954bb2c50 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb @@ -0,0 +1,906 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/recommender/v1/recommender_service_pb" +require "google/cloud/recommender/v1/recommender" + +class ::Google::Cloud::Recommender::V1::Recommender::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_insights + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::ListInsightsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_insights_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_insights, name + assert_kind_of ::Google::Cloud::Recommender::V1::ListInsightsRequest, 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_insights_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_insights({ 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_insights 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_insights ::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights({ 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_insights(::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights_client_stub.call_rpc_count + end + end + + def test_get_insight + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Insight.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_insight_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_insight, name + assert_kind_of ::Google::Cloud::Recommender::V1::GetInsightRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_insight_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_insight({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_insight name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_insight ::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_insight({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_insight(::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_insight_client_stub.call_rpc_count + end + end + + def test_mark_insight_accepted + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Insight.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_insight_accepted_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mark_insight_accepted, name + assert_kind_of ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, request + assert_equal "hello world", request["name"] + assert_equal({}, request["state_metadata"].to_h) + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mark_insight_accepted_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mark_insight_accepted name: name, state_metadata: state_metadata, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mark_insight_accepted ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mark_insight_accepted(::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mark_insight_accepted_client_stub.call_rpc_count + end + end + + def test_list_recommendations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_recommendations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_recommendations, name + assert_kind_of ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, 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_recommendations_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_recommendations({ 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_recommendations 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_recommendations ::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations({ 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_recommendations(::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations_client_stub.call_rpc_count + end + end + + def test_get_recommendation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recommendation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_recommendation, name + assert_kind_of ::Google::Cloud::Recommender::V1::GetRecommendationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_recommendation_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_recommendation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_recommendation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_recommendation ::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_recommendation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_recommendation(::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_recommendation_client_stub.call_rpc_count + end + end + + def test_mark_recommendation_dismissed + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + mark_recommendation_dismissed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mark_recommendation_dismissed, name + assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mark_recommendation_dismissed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mark_recommendation_dismissed({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mark_recommendation_dismissed name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mark_recommendation_dismissed ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.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.mark_recommendation_dismissed({ 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.mark_recommendation_dismissed(::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.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, mark_recommendation_dismissed_client_stub.call_rpc_count + end + end + + def test_mark_recommendation_claimed + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_claimed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mark_recommendation_claimed, name + assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, request + assert_equal "hello world", request["name"] + assert_equal({}, request["state_metadata"].to_h) + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mark_recommendation_claimed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mark_recommendation_claimed name: name, state_metadata: state_metadata, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mark_recommendation_claimed ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mark_recommendation_claimed(::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mark_recommendation_claimed_client_stub.call_rpc_count + end + end + + def test_mark_recommendation_succeeded + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_succeeded_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mark_recommendation_succeeded, name + assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, request + assert_equal "hello world", request["name"] + assert_equal({}, request["state_metadata"].to_h) + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mark_recommendation_succeeded_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mark_recommendation_succeeded name: name, state_metadata: state_metadata, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mark_recommendation_succeeded ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mark_recommendation_succeeded(::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mark_recommendation_succeeded_client_stub.call_rpc_count + end + end + + def test_mark_recommendation_failed + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + state_metadata = {} + etag = "hello world" + + mark_recommendation_failed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :mark_recommendation_failed, name + assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, request + assert_equal "hello world", request["name"] + assert_equal({}, request["state_metadata"].to_h) + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, mark_recommendation_failed_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.mark_recommendation_failed name: name, state_metadata: state_metadata, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.mark_recommendation_failed ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.mark_recommendation_failed(::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, mark_recommendation_failed_client_stub.call_rpc_count + end + end + + def test_get_recommender_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::RecommenderConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_recommender_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_recommender_config, name + assert_kind_of ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_recommender_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_recommender_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_recommender_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_recommender_config ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_recommender_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_recommender_config(::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_recommender_config_client_stub.call_rpc_count + end + end + + def test_update_recommender_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::RecommenderConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + recommender_config = {} + update_mask = {} + validate_only = true + + update_recommender_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_recommender_config, name + assert_kind_of ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Recommender::V1::RecommenderConfig), request["recommender_config"] + 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_recommender_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_recommender_config recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_recommender_config ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_recommender_config(::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_recommender_config_client_stub.call_rpc_count + end + end + + def test_get_insight_type_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_insight_type_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_insight_type_config, name + assert_kind_of ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_insight_type_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_insight_type_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_insight_type_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_insight_type_config ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_insight_type_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_insight_type_config(::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_insight_type_config_client_stub.call_rpc_count + end + end + + def test_update_insight_type_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + insight_type_config = {} + update_mask = {} + validate_only = true + + update_insight_type_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_insight_type_config, name + assert_kind_of ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Recommender::V1::InsightTypeConfig), request["insight_type_config"] + 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_insight_type_config_client_stub do + # Create client + client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_insight_type_config insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_insight_type_config ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_insight_type_config(::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_insight_type_config_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::Recommender::V1::Recommender::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::Recommender::V1::Recommender::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::Recommender::V1::Recommender::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Recommender::V1::Recommender::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/helper.rb b/owl-bot-staging/google-cloud-recommender-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender-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-recommender/.gitignore b/owl-bot-staging/google-cloud-recommender/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/.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-recommender/.repo-metadata.json b/owl-bot-staging/google-cloud-recommender/.repo-metadata.json new file mode 100644 index 000000000000..9069bad13eac --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "recommender.googleapis.com", + "api_shortname": "recommender", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommender/latest", + "distribution_name": "google-cloud-recommender", + "is_cloud": true, + "language": "ruby", + "name": "recommender", + "name_pretty": "Recommender API", + "product_documentation": "https://cloud.google.com/recommender", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services.", + "ruby-cloud-env-prefix": "RECOMMENDER", + "ruby-cloud-product-url": "https://cloud.google.com/recommender", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-recommender/.rubocop.yml b/owl-bot-staging/google-cloud-recommender/.rubocop.yml new file mode 100644 index 000000000000..7215da5958f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-recommender.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-recommender.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recommender/.toys.rb b/owl-bot-staging/google-cloud-recommender/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/.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-recommender/.yardopts b/owl-bot-staging/google-cloud-recommender/.yardopts new file mode 100644 index 000000000000..06acaa595a14 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Recommender 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-recommender/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md new file mode 100644 index 000000000000..f4a097096b14 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-recommender 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-recommender 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/recommender" + +client = Google::Cloud::Recommender.recommender_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/recommender" + +Google::Cloud::Recommender.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Recommender.recommender_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-recommender +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/recommender" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Recommender.recommender_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-recommender/CHANGELOG.md b/owl-bot-staging/google-cloud-recommender/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-recommender/Gemfile b/owl-bot-staging/google-cloud-recommender/Gemfile new file mode 100644 index 000000000000..1aa2e2245658 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-recommender-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recommender.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-recommender/LICENSE.md b/owl-bot-staging/google-cloud-recommender/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/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-recommender/README.md b/owl-bot-staging/google-cloud-recommender/README.md new file mode 100644 index 000000000000..38b53ad2f622 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Recommender API + +API Client library for the Recommender API + +Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-recommender-v*`. +The gem `google-cloud-recommender` 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-recommender/latest) +for this library, google-cloud-recommender, 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-recommender-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/recommender) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-recommender +``` + +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/recommender.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/recommender" + +client = Google::Cloud::Recommender.recommender_service +request = ::Google::Cloud::Recommender::V1::ListInsightsRequest.new # (request fields as keyword arguments...) +response = client.list_insights 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-recommender-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-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-recommender`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-recommender-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-recommender`. +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-recommender-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-recommender/Rakefile b/owl-bot-staging/google-cloud-recommender/Rakefile new file mode 100644 index 000000000000..c04db1ffb5eb --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/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-recommender acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["RECOMMENDER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["RECOMMENDER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["RECOMMENDER_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 RECOMMENDER_TEST_PROJECT=test123 RECOMMENDER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/recommender/v1/recommender/credentials" + ::Google::Cloud::Recommender::V1::Recommender::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["RECOMMENDER_PROJECT"] = project + ENV["RECOMMENDER_TEST_PROJECT"] = project + ENV["RECOMMENDER_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-recommender 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-recommender 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-recommender 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-recommender gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-recommender" + header "google-cloud-recommender rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-recommender yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-recommender 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-recommender 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-recommender 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-recommender/google-cloud-recommender.gemspec b/owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec new file mode 100644 index 000000000000..898eb3e719f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/recommender/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-recommender" + gem.version = Google::Cloud::Recommender::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services." + gem.summary = "API Client library for the Recommender 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-recommender-v1", ">= 0.17", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb b/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb new file mode 100644 index 000000000000..ac3b14c26b03 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.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/recommender" unless defined? Google::Cloud::Recommender::VERSION diff --git a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb new file mode 100644 index 000000000000..2bd4d3d9d48e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/recommender/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! :recommender 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 Recommender + ## + # Create a new client object for Recommender. + # + # By default, this returns an instance of + # [Google::Cloud::Recommender::V1::Recommender::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest/Google-Cloud-Recommender-V1-Recommender-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 Recommender 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 Recommender service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Recommender.recommender_service_available?}. + # + # ## About Recommender + # + # Provides insights and recommendations for cloud customers for various + # categories like performance optimization, cost savings, reliability, feature + # discovery, etc. Insights and recommendations are generated automatically + # based on analysis of user resources, configuration and monitoring metrics. + # + # @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.recommender_service version: :v1, transport: :grpc, &block + require "google/cloud/recommender/#{version.to_s.downcase}" + + package_name = Google::Cloud::Recommender + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Recommender.const_get(package_name).const_get(:Recommender) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Recommender service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Recommender.recommender_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 Recommender service, + # or if the versioned client gem needs an update to support the Recommender 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.recommender_service_available? version: :v1, transport: :grpc + require "google/cloud/recommender/#{version.to_s.downcase}" + package_name = Google::Cloud::Recommender + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Recommender.const_get package_name + return false unless service_module.const_defined? :Recommender + service_module = service_module.const_get :Recommender + 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-recommender 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.recommender if block_given? + + ::Google::Cloud.configure.recommender + end + end + end +end + +helper_path = ::File.join __dir__, "recommender", "helpers.rb" +require "google/cloud/recommender/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb new file mode 100644 index 000000000000..7e2bc1ccb49e --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/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 Recommender + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb new file mode 100644 index 000000000000..c7303bf4879a --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/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/recommender" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Recommender::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_recommender_service_grpc + skip unless Google::Cloud::Recommender.recommender_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::Recommender.recommender_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Recommender::V1::Recommender::Client, client + end + end + + def test_recommender_service_rest + skip unless Google::Cloud::Recommender.recommender_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Recommender.recommender_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Recommender::V1::Recommender::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb new file mode 100644 index 000000000000..c28abec8aed6 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/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/recommender/version" + +class Google::Cloud::Recommender::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Recommender::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-recommender/test/helper.rb b/owl-bot-staging/google-cloud-recommender/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-recommender/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-cluster-v1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json new file mode 100644 index 000000000000..4dc4ab2c485b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest", + "distribution_name": "google-cloud-redis-cluster-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/cluster", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml new file mode 100644 index 000000000000..b44047501f44 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-cluster-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-cluster-v1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1/.yardopts new file mode 100644 index 000000000000..6b73bdb64053 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..f468015d7991 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-cluster-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-cluster-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/cluster/v1" + +client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/cluster/v1" + +::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-redis-cluster-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/cluster/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1/README.md new file mode 100644 index 000000000000..d2c06dbded3f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-redis-cluster-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/cluster/v1" + +client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new +request = ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new # (request fields as keyword arguments...) +response = client.list_clusters request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/redis/cluster/v1" +require "logger" + +client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-redis-cluster`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-cluster-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-cluster`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-redis-cluster-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-cluster-v1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1/Rakefile new file mode 100644 index 000000000000..05f433f76c68 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-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/redis/cluster/v1/cloud_redis_cluster/credentials" + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-redis-cluster-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-cluster-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-cluster-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-cluster-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-cluster-v1" + header "google-cloud-redis-cluster-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-cluster-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-cluster-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-cluster-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-cluster-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-cluster-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json new file mode 100644 index 000000000000..17aa593b5298 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.redis.cluster.v1", + "libraryPackage": "::Google::Cloud::Redis::Cluster::V1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client", + "rpcs": { + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "GetClusterCertificateAuthority": { + "methods": [ + "get_cluster_certificate_authority" + ] + }, + "RescheduleClusterMaintenance": { + "methods": [ + "reschedule_cluster_maintenance" + ] + }, + "ListBackupCollections": { + "methods": [ + "list_backup_collections" + ] + }, + "GetBackupCollection": { + "methods": [ + "get_backup_collection" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ExportBackup": { + "methods": [ + "export_backup" + ] + }, + "BackupCluster": { + "methods": [ + "backup_cluster" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec new file mode 100644 index 000000000000..412b717e7cb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/cluster/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-cluster-v1" + gem.version = Google::Cloud::Redis::Cluster::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-cluster-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." + gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.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-cluster-v1/lib/google-cloud-redis-cluster-v1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-v1.rb new file mode 100644 index 000000000000..ad69d0f55f24 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-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/cluster/v1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb new file mode 100644 index 000000000000..b90b149f1c11 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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/redis/cluster/v1/cloud_redis_cluster" +require "google/cloud/redis/cluster/v1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/redis/cluster/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb new file mode 100644 index 000000000000..921b92c9c5a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Redis + module Cluster + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/redis/cluster/v1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/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 +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..1723c4483690 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/redis/cluster/v1/version" + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/operations" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/client" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1/cloud_redis_cluster" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb new file mode 100644 index 000000000000..bed8f3e71ba5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb @@ -0,0 +1,1958 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" +require "google/cloud/location" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + ## + # Client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "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_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @cloud_redis_cluster_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.cluster&.name + header_params["cluster.name"] = request.cluster.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :export_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.backup_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :backup_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudRedisCluster API. + # + # This class represents the configuration for CloudRedisCluster, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CloudRedisCluster API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb new file mode 100644 index 000000000000..a1aec2d413d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + # Credentials for the CloudRedisCluster API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb new file mode 100644 index 000000000000..747f251366ae --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb new file mode 100644 index 000000000000..b91229a8ebc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + # Path helper methods for the CloudRedisCluster API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup_collection:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupCollection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # + # @return [::String] + def backup_collection_path project:, location:, backup_collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" + end + + ## + # Create a fully-qualified CertificateAuthority resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def certificate_authority_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified ForwardingRule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` + # + # @param project [String] + # @param region [String] + # @param forwarding_rule [String] + # + # @return [::String] + def forwarding_rule_path project:, region:, forwarding_rule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified ServiceAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` + # + # @param project [String] + # @param region [String] + # @param service_attachment [String] + # + # @return [::String] + def service_attachment_path project:, region:, service_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb new file mode 100644 index 000000000000..1ac33481a165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/redis/cluster/v1/version" +require "google/cloud/redis/cluster/v1/bindings_override" + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client" + +module Google + module Cloud + module Redis + module Cluster + module V1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb new file mode 100644 index 000000000000..57fcd4439829 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb @@ -0,0 +1,1825 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + module Rest + ## + # REST client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "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_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_redis_cluster_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.update_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.create_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster_certificate_authority request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.reschedule_cluster_maintenance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.export_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.backup_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.backup_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudRedisCluster REST API. + # + # This class represents the configuration for CloudRedisCluster REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudRedisCluster API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb new file mode 100644 index 000000000000..80457d34dddb --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb @@ -0,0 +1,926 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb new file mode 100644 index 000000000000..7a2343f54ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb @@ -0,0 +1,942 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + module Rest + ## + # REST service stub for the CloudRedisCluster service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::Cluster.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] + # A result object deserialized from the server's reply + def get_cluster_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cluster_certificate_authority", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::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 reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def reschedule_cluster_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "reschedule_cluster_maintenance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse] + # A result object deserialized from the server's reply + def list_backup_collections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_collections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] + # A result object deserialized from the server's reply + def get_backup_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1::Backup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def export_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def backup_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "backup_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_cluster_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rescheduleClusterMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_collections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backupCollections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_backup_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:backup", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb new file mode 100644 index 000000000000..81a3ee3e4f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n7google/cloud/redis/cluster/v1/cloud_redis_cluster.proto\x12\x1dgoogle.cloud.redis.cluster.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#google/longrunning/operations.proto\x1a\x19google/protobuf/any.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\"\xbc\x01\n\x14\x43reateClusterRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x07\x63luster\x18\x03 \x01(\x0b\x32&.google.cloud.redis.cluster.v1.ClusterB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"w\n\x13ListClustersRequest\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\"~\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32&.google.cloud.redis.cluster.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12<\n\x07\x63luster\x18\x02 \x01(\x0b\x32&.google.cloud.redis.cluster.v1.ClusterB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"G\n\x11GetClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\"^\n\x14\x44\x65leteClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"h\n%GetClusterCertificateAuthorityRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)redis.googleapis.com/CertificateAuthority\"\x8e\x01\n\x1cListBackupCollectionsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%redis.googleapis.com/BackupCollection\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\"\x9a\x01\n\x1dListBackupCollectionsResponse\x12K\n\x12\x62\x61\x63kup_collections\x18\x01 \x03(\x0b\x32/.google.cloud.redis.cluster.v1.BackupCollection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Y\n\x1aGetBackupCollectionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%redis.googleapis.com/BackupCollection\"z\n\x12ListBackupsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bredis.googleapis.com/Backup\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\x13ListBackupsResponse\x12\x36\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32%.google.cloud.redis.cluster.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"E\n\x10GetBackupRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/Backup\"i\n\x13\x44\x65leteBackupRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"m\n\x13\x45xportBackupRequest\x12\x14\n\ngcs_bucket\x18\x03 \x01(\tH\x00\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/BackupB\r\n\x0b\x64\x65stination\"\xa2\x01\n\x14\x42\x61\x63kupClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\tbackup_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0c\n\n_backup_id\"\xd0\x16\n\x07\x43luster\x12Q\n\ngcs_source\x18\" \x01(\x0b\x32\x36.google.cloud.redis.cluster.v1.Cluster.GcsBackupSourceB\x03\xe0\x41\x01H\x00\x12`\n\x15managed_backup_source\x18# \x01(\x0b\x32:.google.cloud.redis.cluster.v1.Cluster.ManagedBackupSourceB\x03\xe0\x41\x01H\x00\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x05state\x18\x04 \x01(\x0e\x32,.google.cloud.redis.cluster.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\rreplica_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12Q\n\x12\x61uthorization_mode\x18\x0b \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1.AuthorizationModeB\x03\xe0\x41\x01\x12Z\n\x17transit_encryption_mode\x18\x0c \x01(\x0e\x32\x34.google.cloud.redis.cluster.v1.TransitEncryptionModeB\x03\xe0\x41\x01\x12\x19\n\x07size_gb\x18\r \x01(\x05\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1d\n\x0bshard_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x42\n\x0bpsc_configs\x18\x0f \x03(\x0b\x32(.google.cloud.redis.cluster.v1.PscConfigB\x03\xe0\x41\x01\x12R\n\x13\x64iscovery_endpoints\x18\x10 \x03(\x0b\x32\x30.google.cloud.redis.cluster.v1.DiscoveryEndpointB\x03\xe0\x41\x03\x12J\n\x0fpsc_connections\x18\x11 \x03(\x0b\x32,.google.cloud.redis.cluster.v1.PscConnectionB\x03\xe0\x41\x03\x12I\n\nstate_info\x18\x12 \x01(\x0b\x32\x30.google.cloud.redis.cluster.v1.Cluster.StateInfoB\x03\xe0\x41\x03\x12?\n\tnode_type\x18\x13 \x01(\x0e\x32\'.google.cloud.redis.cluster.v1.NodeTypeB\x03\xe0\x41\x01\x12X\n\x12persistence_config\x18\x14 \x01(\x0b\x32\x37.google.cloud.redis.cluster.v1.ClusterPersistenceConfigB\x03\xe0\x41\x01\x12T\n\rredis_configs\x18\x15 \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1.Cluster.RedisConfigsEntryB\x03\xe0\x41\x01\x12!\n\x0fprecise_size_gb\x18\x16 \x01(\x01\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\\\n\x18zone_distribution_config\x18\x17 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1.ZoneDistributionConfigB\x03\xe0\x41\x01\x12k\n cross_cluster_replication_config\x18\x18 \x01(\x0b\x32<.google.cloud.redis.cluster.v1.CrossClusterReplicationConfigB\x03\xe0\x41\x01\x12-\n\x1b\x64\x65letion_protection_enabled\x18\x19 \x01(\x08\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12]\n\x12maintenance_policy\x18\x1a \x01(\x0b\x32\x37.google.cloud.redis.cluster.v1.ClusterMaintenancePolicyB\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x61\n\x14maintenance_schedule\x18\x1b \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12Y\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1.PscServiceAttachmentB\x03\xe0\x41\x03\x12N\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32..google.cloud.redis.cluster.v1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12Z\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x34.google.cloud.redis.cluster.v1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12K\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32-.google.cloud.redis.cluster.v1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xea\x01\n\tStateInfo\x12R\n\x0bupdate_info\x18\x01 \x01(\x0b\x32;.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x85\x04\n\x15\x41utomatedBackupConfig\x12t\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32K.google.cloud.redis.cluster.v1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12l\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32H.google.cloud.redis.cluster.v1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x82\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32).google.cloud.redis.cluster.v1.BackupFileB\x03\xe0\x41\x03\x12?\n\tnode_type\x18\t \x01(\x0e\x32\'.google.cloud.redis.cluster.v1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12J\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1.Backup.BackupTypeB\x03\xe0\x41\x03\x12?\n\x05state\x18\r \x01(\x0e\x32+.google.cloud.redis.cluster.v1.Backup.StateB\x03\xe0\x41\x03\x12K\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32-.google.cloud.redis.cluster.v1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x84\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"\xf4\x06\n\x1d\x43rossClusterReplicationConfig\x12^\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32H.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.ClusterRole\x12\x63\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster\x12\x66\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12`\n\nmembership\x18\x05 \x01(\x0b\x32G.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xe3\x01\n\nMembership\x12h\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12k\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xe8\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12`\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32=.google.cloud.redis.cluster.v1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x7f\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x41\n\npsc_config\x18\x03 \x01(\x0b\x32(.google.cloud.redis.cluster.v1.PscConfigB\x03\xe0\x41\x03\"\xda\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12V\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.PscConnectionStatusB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"W\n\x0f\x43lusterEndpoint\x12\x44\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32/.google.cloud.redis.cluster.v1.ConnectionDetail\"\xb9\x01\n\x10\x43onnectionDetail\x12O\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x30.google.cloud.redis.cluster.v1.PscAutoConnectionH\x00\x12\x46\n\x0epsc_connection\x18\x02 \x01(\x0b\x32,.google.cloud.redis.cluster.v1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xde\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12V\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.PscConnectionStatusB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x85\x04\n\x14\x43\x65rtificateAuthority\x12l\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xad\x01\n\x1bManagedCertificateAuthority\x12k\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32Y.google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\x87\x07\n\x18\x43lusterPersistenceConfig\x12Z\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12Z\n\nrdb_config\x18\x02 \x01(\x0b\x32\x41.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12Z\n\naof_config\x18\x03 \x01(\x0b\x32\x41.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xba\x02\n\tRDBConfig\x12r\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32P.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc4\x01\n\tAOFConfig\x12h\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xeb\x01\n\x16ZoneDistributionConfig\x12]\n\x04mode\x18\x01 \x01(\x0e\x32J.google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xd7\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12o\n\x0freschedule_type\x18\x02 \x01(\x0e\x32Q.google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\xfa\x04\n\x0e\x45ncryptionInfo\x12P\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12]\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32\x39.google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\x93\x18\n\x11\x43loudRedisCluster\x12\xb6\x01\n\x0cListClusters\x12\x32.google.cloud.redis.cluster.v1.ListClustersRequest\x1a\x33.google.cloud.redis.cluster.v1.ListClustersResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/clusters\x12\xa3\x01\n\nGetCluster\x12\x30.google.cloud.redis.cluster.v1.GetClusterRequest\x1a&.google.cloud.redis.cluster.v1.Cluster\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/clusters/*}\x12\xe1\x01\n\rUpdateCluster\x12\x33.google.cloud.redis.cluster.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xcf\x01\n\rDeleteCluster\x12\x33.google.cloud.redis.cluster.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/clusters/*}\x12\xdf\x01\n\rCreateCluster\x12\x33.google.cloud.redis.cluster.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xed\x01\n\x1eGetClusterCertificateAuthority\x12\x44.google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest\x1a\x33.google.cloud.redis.cluster.v1.CertificateAuthority\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\x9e\x02\n\x1cRescheduleClusterMaintenance\x12\x42.google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xda\x01\n\x15ListBackupCollections\x12;.google.cloud.redis.cluster.v1.ListBackupCollectionsRequest\x1a<.google.cloud.redis.cluster.v1.ListBackupCollectionsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/backupCollections\x12\xc7\x01\n\x13GetBackupCollection\x12\x39.google.cloud.redis.cluster.v1.GetBackupCollectionRequest\x1a/.google.cloud.redis.cluster.v1.BackupCollection\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/backupCollections/*}\x12\xc6\x01\n\x0bListBackups\x12\x31.google.cloud.redis.cluster.v1.ListBackupsRequest\x1a\x32.google.cloud.redis.cluster.v1.ListBackupsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xb3\x01\n\tGetBackup\x12/.google.cloud.redis.cluster.v1.GetBackupRequest\x1a%.google.cloud.redis.cluster.v1.Backup\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xe0\x01\n\x0c\x44\x65leteBackup\x12\x32.google.cloud.redis.cluster.v1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xd4\x01\n\x0c\x45xportBackup\x12\x32.google.cloud.redis.cluster.v1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02K\"F/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xcb\x01\n\rBackupCluster\x12\x33.google.cloud.redis.cluster.v1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xff\x05\n!com.google.cloud.redis.cluster.v1B\x16\x43loudRedisClusterProtoP\x01Z;cloud.google.com/go/redis/cluster/apiv1/clusterpb;clusterpb\xea\x02!Google::Cloud::Redis::Cluster::V1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +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.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.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 Cluster + module V1 + CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CreateClusterRequest").msgclass + ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListClustersRequest").msgclass + ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListClustersResponse").msgclass + UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.UpdateClusterRequest").msgclass + GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetClusterRequest").msgclass + DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DeleteClusterRequest").msgclass + GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest").msgclass + ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupCollectionsRequest").msgclass + ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupCollectionsResponse").msgclass + GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetBackupCollectionRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupsResponse").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetBackupRequest").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DeleteBackupRequest").msgclass + ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ExportBackupRequest").msgclass + BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupClusterRequest").msgclass + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster").msgclass + Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.StateInfo").msgclass + Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo").msgclass + Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.GcsBackupSource").msgclass + Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.ManagedBackupSource").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.State").enummodule + AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig").msgclass + AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass + AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig.AutomatedBackupMode").enummodule + BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupCollection").msgclass + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup").msgclass + Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup.BackupType").enummodule + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup.State").enummodule + BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupFile").msgclass + PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscServiceAttachment").msgclass + CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig").msgclass + CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster").msgclass + CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.Membership").msgclass + CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.ClusterRole").enummodule + ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterMaintenancePolicy").msgclass + ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterWeeklyMaintenanceWindow").msgclass + ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterMaintenanceSchedule").msgclass + PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConfig").msgclass + DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DiscoveryEndpoint").msgclass + PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConnection").msgclass + ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterEndpoint").msgclass + ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ConnectionDetail").msgclass + PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscAutoConnection").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.OperationMetadata").msgclass + CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass + ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig").msgclass + ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig").msgclass + ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule + ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig").msgclass + ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule + ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode").enummodule + ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ZoneDistributionConfig").msgclass + ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode").enummodule + RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest").msgclass + RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo.Type").enummodule + EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyState").enummodule + PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConnectionStatus").enummodule + AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AuthorizationMode").enummodule + NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.NodeType").enummodule + TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.TransitEncryptionMode").enummodule + ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ConnectionType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb new file mode 100644 index 000000000000..c12f58333748 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb @@ -0,0 +1,122 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.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/cluster/v1/cloud_redis_cluster_pb' + +module Google + module Cloud + module Redis + module Cluster + module V1 + module CloudRedisCluster + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.redis.cluster.v1.CloudRedisCluster' + + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse + # Gets the details of a specific Redis cluster. + rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1::Cluster + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Google::Longrunning::Operation + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Google::Longrunning::Operation + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Google::Longrunning::Operation + # Gets the details of certificate authority information for Redis cluster. + rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1::CertificateAuthority + # Reschedules upcoming maintenance event. + rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse + # Get a backup collection. + rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1::BackupCollection + # Lists all backups owned by a backup collection. + rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse + # Gets the details of a specific backup. + rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1::Backup + # Deletes a specific backup. + rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Google::Longrunning::Operation + # Exports a specific backup to a customer target Cloud Storage URI. + rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Google::Longrunning::Operation + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb new file mode 100644 index 000000000000..67b43a7fe970 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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/redis/cluster/v1/cloud_redis_cluster/rest" +require "google/cloud/redis/cluster/v1/bindings_override" +require "google/cloud/redis/cluster/v1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/redis/cluster/v1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb new file mode 100644 index 000000000000..d7f95f4db5ed --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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 Redis + module Cluster + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md new file mode 100644 index 000000000000..49fbb528a7ef --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-redis-cluster-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..1e14c692c0ef --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb @@ -0,0 +1,1301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1 + # Request for [CreateCluster][CloudRedis.CreateCluster]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] + # Required. The cluster that is to be created. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::Cluster>] + # A list of Redis clusters in the project in the specified location, + # or across all locations. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # Redis entry is included in the response with the `name` field set to a + # value of the form + # `projects/{project_id}/locations/{location_id}/clusters/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListClusters". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [UpdateCluster][CloudRedis.UpdateCluster]. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetCluster][CloudRedis.GetCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteCluster][CloudRedis.DeleteCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + class GetClusterCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackupCollections] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupCollectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackupCollections]. + # @!attribute [rw] backup_collections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] + # A list of backupCollections in the project. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # backupCollection entry is included in the response with the `name` field + # set to a value of the form + # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListBackupCollections". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupCollectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackupCollection]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + class GetBackupCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackups]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackups]. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::Backup>] + # A list of backups in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Backups that could not be reached. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Idempotent request UUID. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ExportBackup]. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class ExportBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [BackupCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @!attribute [rw] backup_id + # @return [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + class BackupClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cluster instance. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::GcsBackupSource] + # Optional. Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # Read permission is required to import from the provided Cloud Storage + # objects. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] managed_backup_source + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::ManagedBackupSource] + # Optional. Backups generated and managed by memorystore service. + # + # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. Identifier. Unique name of the resource in this scope including + # project and location using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp associated with the cluster creation request. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::State] + # Output only. The current state of this cluster. + # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned, unique identifier for the cluster. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of replica nodes per shard. + # @!attribute [rw] authorization_mode + # @return [::Google::Cloud::Redis::Cluster::V1::AuthorizationMode] + # Optional. The authorization mode of the Redis cluster. + # If not provided, auth feature is disabled for the cluster. + # @!attribute [rw] transit_encryption_mode + # @return [::Google::Cloud::Redis::Cluster::V1::TransitEncryptionMode] + # Optional. The in-transit encryption for the Redis cluster. + # If not provided, encryption is disabled for the cluster. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Redis memory size in GB for the entire cluster rounded up to + # the next integer. + # @!attribute [rw] shard_count + # @return [::Integer] + # Optional. Number of shards for the Redis cluster. + # @!attribute [rw] psc_configs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscConfig>] + # Optional. Each PscConfig configures the consumer network where IPs will + # be designated to the cluster for client access through Private Service + # Connect Automation. Currently, only one PscConfig is supported. + # @!attribute [r] discovery_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::DiscoveryEndpoint>] + # Output only. Endpoints created on each given network, for Redis clients to + # connect to the cluster. Currently only one discovery endpoint is supported. + # @!attribute [r] psc_connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscConnection>] + # Output only. The list of PSC connections that are auto-created through + # service connectivity automation. + # @!attribute [r] state_info + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::StateInfo] + # Output only. Additional information about the current state of the cluster. + # @!attribute [rw] node_type + # @return [::Google::Cloud::Redis::Cluster::V1::NodeType] + # Optional. The type of a redis node in the cluster. NodeType determines the + # underlying machine-type of a redis node. + # @!attribute [rw] persistence_config + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig] + # Optional. Persistence config (RDB, AOF) for the cluster. + # @!attribute [rw] redis_configs + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Key/Value pairs of customer overrides for mutable Redis Configs + # @!attribute [r] precise_size_gb + # @return [::Float] + # Output only. Precise value of redis memory size in GB for the entire + # cluster. + # @!attribute [rw] zone_distribution_config + # @return [::Google::Cloud::Redis::Cluster::V1::ZoneDistributionConfig] + # Optional. This config will be used to determine how the customer wants us + # to distribute cluster resources within the region. + # @!attribute [rw] cross_cluster_replication_config + # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig] + # Optional. Cross cluster replication config. + # @!attribute [rw] deletion_protection_enabled + # @return [::Boolean] + # Optional. The delete operation will fail when the value is set to true. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterMaintenancePolicy] + # Optional. ClusterMaintenancePolicy determines when to allow or deny + # updates. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterMaintenanceSchedule] + # Output only. ClusterMaintenanceSchedule Output only Published maintenance + # schedule. + # @!attribute [r] psc_service_attachments + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscServiceAttachment>] + # Output only. Service attachment details to configure Psc connections + # @!attribute [rw] cluster_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ClusterEndpoint>] + # Optional. A list of cluster enpoints. + # @!attribute [r] backup_collection + # @return [::String] + # Optional. Output only. The backup collection full resource name. Example: + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} + # @!attribute [rw] kms_key + # @return [::String] + # Optional. The KMS key used to encrypt the at-rest data of the cluster. + # @!attribute [rw] automated_backup_config + # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig] + # Optional. The automated backup config for the cluster. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo] + # Output only. Encryption information of the data at rest of the cluster. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents additional information about the state of the cluster. + # @!attribute [rw] update_info + # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::StateInfo::UpdateInfo] + # Describes ongoing update on the cluster when cluster state is UPDATING. + class StateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents information about an updating cluster. + # @!attribute [rw] target_shard_count + # @return [::Integer] + # Target number of shards for redis cluster + # @!attribute [rw] target_replica_count + # @return [::Integer] + # Target number of replica nodes per shard. + class UpdateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Optional. URIs of the GCS objects to import. + # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 + class GcsBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backups that generated and managed by memorystore. + # @!attribute [rw] backup + # @return [::String] + # Optional. Example: + # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} + # A shorter version (without the prefix) of the backup name is also + # supported, like + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} + # In this case, it assumes the backup is under redis.googleapis.com. + class ManagedBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RedisConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states of a Redis cluster. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # Redis cluster is being created. + CREATING = 1 + + # Redis cluster has been created and is fully usable. + ACTIVE = 2 + + # Redis cluster configuration is being updated. + UPDATING = 3 + + # Redis cluster is being deleted. + DELETING = 4 + end + end + + # The automated backup config for a cluster. + # @!attribute [rw] fixed_frequency_schedule + # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig::FixedFrequencySchedule] + # Optional. Trigger automated backups at a fixed frequency. + # @!attribute [rw] automated_backup_mode + # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig::AutomatedBackupMode] + # Optional. The automated backup mode. If the mode is disabled, the other + # fields will be ignored. + # @!attribute [rw] retention + # @return [::Google::Protobuf::Duration] + # Optional. How long to keep automated backups before the backups are + # deleted. The value should be between 1 day and 365 days. If not specified, + # the default value is 35 days. + class AutomatedBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This schedule allows the backup to be triggered at a fixed frequency + # (currently only daily is supported). + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. The start time of every automated backup in UTC. It must be set + # to the start of an hour. This field is required. + class FixedFrequencySchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The automated backup mode. + module AutomatedBackupMode + # Default value. Automated backup config is not specified. + AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 + + # Automated backup config disabled. + DISABLED = 1 + + # Automated backup config enabled. + ENABLED = 2 + end + end + + # BackupCollection of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup collection. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The cluster uid of the backup collection. + # @!attribute [r] cluster + # @return [::String] + # Output only. The full resource path of the cluster the backup collection + # belongs to. Example: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @!attribute [r] kms_key + # @return [::String] + # Output only. The KMS key used to encrypt the backups under this backup + # collection. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup collection. + class BackupCollection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup. the last part of the name is + # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster + # UID] OR customer specified while backup cluster. Example: + # 20240515123000_1234 + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup was created. + # @!attribute [r] cluster + # @return [::String] + # Output only. Cluster resource path of this backup. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. Cluster uid of this backup. + # @!attribute [r] total_size_bytes + # @return [::Integer] + # Output only. Total size of the backup in bytes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup will expire. + # @!attribute [r] engine_version + # @return [::String] + # Output only. redis-7.2, valkey-7.5 + # @!attribute [r] backup_files + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::BackupFile>] + # Output only. List of backup files of the backup. + # @!attribute [r] node_type + # @return [::Google::Cloud::Redis::Cluster::V1::NodeType] + # Output only. Node type of the cluster. + # @!attribute [r] replica_count + # @return [::Integer] + # Output only. Number of replicas for the cluster. + # @!attribute [r] shard_count + # @return [::Integer] + # Output only. Number of shards for the cluster. + # @!attribute [r] backup_type + # @return [::Google::Cloud::Redis::Cluster::V1::Backup::BackupType] + # Output only. Type of the backup. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1::Backup::State] + # Output only. State of the backup. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo] + # Output only. Encryption information of the backup. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the backup. + module BackupType + # The default value, not set. + BACKUP_TYPE_UNSPECIFIED = 0 + + # On-demand backup. + ON_DEMAND = 1 + + # Automated backup. + AUTOMATED = 2 + end + + # State of the backup. + module State + # The default value, not set. + STATE_UNSPECIFIED = 0 + + # The backup is being created. + CREATING = 1 + + # The backup is active to be used. + ACTIVE = 2 + + # The backup is being deleted. + DELETING = 3 + + # The backup is currently suspended due to reasons like project deletion, + # billing account closure, etc. + SUSPENDED = 4 + end + end + + # Backup is consisted of multiple backup files. + # @!attribute [r] file_name + # @return [::String] + # Output only. e.g: .rdb + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Size of the backup file in bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup file was created. + class BackupFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of a service attachment of the cluster, for creating PSC + # connections. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. Service attachment URI which your self-created PscConnection + # should use as target + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] + # Output only. Type of a PSC connection targeting this service attachment. + class PscServiceAttachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cross cluster replication config. + # @!attribute [rw] cluster_role + # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::ClusterRole] + # The role of the cluster in cross cluster replication. + # @!attribute [rw] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster] + # Details of the primary cluster that is used as the replication source for + # this secondary cluster. + # + # This field is only set for a secondary cluster. + # @!attribute [rw] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster>] + # List of secondary clusters that are replicating from this primary cluster. + # + # This field is only set for a primary cluster. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time cross cluster replication config was updated. + # @!attribute [r] membership + # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::Membership] + # Output only. An output only view of all the member clusters participating + # in the cross cluster replication. This view will be provided by every + # member cluster irrespective of its cluster role(primary or secondary). + # + # A primary cluster can provide information about all the secondary clusters + # replicating from it. However, a secondary cluster only knows about the + # primary cluster from which it is replicating. However, for scenarios, where + # the primary cluster is unavailable(e.g. regional outage), a GetCluster + # request can be sent to any other member cluster and this field will list + # all the member clusters participating in cross cluster replication. + class CrossClusterReplicationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details of the remote cluster associated with this cluster in a cross + # cluster replication setup. + # @!attribute [rw] cluster + # @return [::String] + # The full resource path of the remote cluster in + # the format: projects//locations//clusters/ + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the remote cluster. + class RemoteCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An output only view of all the member clusters participating in the cross + # cluster replication. + # @!attribute [r] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster] + # Output only. The primary cluster that acts as the source of replication + # for the secondary clusters. + # @!attribute [r] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster>] + # Output only. The list of secondary clusters replicating from the primary + # cluster. + class Membership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The role of the cluster in cross cluster replication. + module ClusterRole + # Cluster role is not set. + # The behavior is equivalent to NONE. + CLUSTER_ROLE_UNSPECIFIED = 0 + + # This cluster does not participate in cross cluster replication. It is an + # independent cluster and does not replicate to or from any other clusters. + NONE = 1 + + # A cluster that allows both reads and writes. Any data written to this + # cluster is also replicated to the attached secondary clusters. + PRIMARY = 2 + + # A cluster that allows only reads and replicates data from a primary + # cluster. + SECONDARY = 3 + end + end + + # Maintenance policy per cluster. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created i.e. Maintenance Window + # or Deny Period was assigned. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated i.e. Maintenance Window + # or Deny Period was updated. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ClusterWeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_maintenance_window is expected to be one. + class ClusterMaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Start time of the window in UTC. + class ClusterWeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maitenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this + # instance. + class ClusterMaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] network + # @return [::String] + # Required. The network where the IP address of the discovery endpoint will + # be reserved, in the form of + # projects/\\{network_project}/global/networks/\\{network_id}. + class PscConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpoints on each network, for Redis clients to connect to the cluster. + # @!attribute [r] address + # @return [::String] + # Output only. Address of the exposed Redis endpoint used by clients to + # connect to the service. The address could be either IP or hostname. + # @!attribute [r] port + # @return [::Integer] + # Output only. The port number of the exposed Redis endpoint. + # @!attribute [r] psc_config + # @return [::Google::Cloud::Redis::Cluster::V1::PscConfig] + # Output only. Customer configuration for where the endpoint is created and + # accessed from. + class DiscoveryEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection. + # @!attribute [rw] psc_connection_id + # @return [::String] + # Required. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [rw] address + # @return [::String] + # Required. The IP allocated on the consumer network for the PSC forwarding + # rule. + # @!attribute [rw] forwarding_rule + # @return [::String] + # Required. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Optional. Project ID of the consumer project where the forwarding rule is + # created in. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [rw] service_attachment + # @return [::String] + # Required. The service attachment which is the target of the PSC connection, + # in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # To get the latest status of a PSC connection, follow + # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] + # Output only. Type of the PSC connection. + class PscConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ClusterEndpoint consists of PSC connections that are created + # as a group in each VPC network for accessing the cluster. In each group, + # there shall be one connection for each service attachment in the cluster. + # @!attribute [rw] connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ConnectionDetail>] + # A group of PSC connections. They are created in the same VPC network, one + # for each service attachment in the cluster. + class ClusterEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed information of each PSC connection. + # @!attribute [rw] psc_auto_connection + # @return [::Google::Cloud::Redis::Cluster::V1::PscAutoConnection] + # Detailed information of a PSC connection that is created through + # service connectivity automation. + # + # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] psc_connection + # @return [::Google::Cloud::Redis::Cluster::V1::PscConnection] + # Detailed information of a PSC connection that is created by the customer + # who owns the cluster. + # + # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ConnectionDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection that is created through + # Service Connectivity Automation. + # @!attribute [r] psc_connection_id + # @return [::String] + # Output only. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [r] address + # @return [::String] + # Output only. The IP allocated on the consumer network for the PSC + # forwarding rule. + # @!attribute [r] forwarding_rule + # @return [::String] + # Output only. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The consumer project_id where the forwarding rule is created + # from. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The service attachment which is the target of the PSC + # connection, in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # Please use Private Service Connect APIs for the latest status. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] + # Output only. Type of the PSC connection. + class PscAutoConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pre-defined metadata fields. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Redis cluster certificate authority + # @!attribute [rw] managed_server_ca + # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority::ManagedCertificateAuthority] + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique name of the resource in this scope including project, + # location and cluster using the form: + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + class CertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] ca_certs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] + # The PEM encoded CA certificate chains for redis managed + # server authentication + class ManagedCertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] certificates + # @return [::Array<::String>] + # The certificates that form the CA chain, from leaf to root order. + class CertChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration of the persistence functionality. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::PersistenceMode] + # Optional. The mode of persistence. + # @!attribute [rw] rdb_config + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::RDBConfig] + # Optional. RDB configuration. This field will be ignored if mode is not RDB. + # @!attribute [rw] aof_config + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::AOFConfig] + # Optional. AOF configuration. This field will be ignored if mode is not AOF. + class ClusterPersistenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the RDB based persistence. + # @!attribute [rw] rdb_snapshot_period + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] + # Optional. Period between RDB snapshots. + # @!attribute [rw] rdb_snapshot_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time that the first snapshot was/will be attempted, and to + # which future snapshots will be aligned. If not provided, the current time + # will be used. + class RDBConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available snapshot periods. + module SnapshotPeriod + # Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0 + + # One hour. + ONE_HOUR = 1 + + # Six hours. + SIX_HOURS = 2 + + # Twelve hours. + TWELVE_HOURS = 3 + + # Twenty four hours. + TWENTY_FOUR_HOURS = 4 + end + end + + # Configuration of the AOF based persistence. + # @!attribute [rw] append_fsync + # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::AOFConfig::AppendFsync] + # Optional. fsync configuration. + class AOFConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available fsync modes. + module AppendFsync + # Not set. Default: EVERYSEC + APPEND_FSYNC_UNSPECIFIED = 0 + + # Never fsync. Normally Linux will flush data every 30 seconds with this + # configuration, but it's up to the kernel's exact tuning. + NO = 1 + + # fsync every second. Fast enough, and you may lose 1 second of data if + # there is a disaster + EVERYSEC = 2 + + # fsync every time new write commands are appended to the AOF. It has the + # best data loss protection at the cost of performance + ALWAYS = 3 + end + end + + # Available persistence modes. + module PersistenceMode + # Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0 + + # Persistence is disabled, and any snapshot data is deleted. + DISABLED = 1 + + # RDB based persistence is enabled. + RDB = 2 + + # AOF based persistence is enabled. + AOF = 3 + end + end + + # Zone distribution config for allocation of cluster resources. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1::ZoneDistributionConfig::ZoneDistributionMode] + # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + # specified. + # @!attribute [rw] zone + # @return [::String] + # Optional. When SINGLE ZONE distribution is selected, zone field would be + # used to allocate all resources in that zone. This is not applicable to + # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + class ZoneDistributionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines various modes of zone distribution. + module ZoneDistributionMode + # Not Set. Default: MULTI_ZONE + ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 + + # Distribute all resources across 3 zones picked at random, within the + # region. + MULTI_ZONE = 1 + + # Distribute all resources in a single zone. The zone field must be + # specified, when this mode is selected. + SINGLE_ZONE = 2 + end + end + + # Request for rescheduling a cluster maintenance. + # @!attribute [rw] name + # @return [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleClusterMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # EncryptionInfo describes the encryption information of a cluster or a backup. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo::Type] + # Output only. Type of encryption. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Output only. KMS key versions that are being used to protect the data + # at-rest. + # @!attribute [r] kms_key_primary_state + # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo::KmsKeyState] + # Output only. The state of the primary version of the KMS key perceived by + # the system. This field is not populated in backups. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time when the encryption info was updated. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is fully managed by Google. + # No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1 + + # The data is encrypted at rest with a key that is managed by the customer. + # KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + + # The state of the KMS key perceived by the system. Refer to the public + # documentation for the impact of each state. + module KmsKeyState + # The default value. This value is unused. + KMS_KEY_STATE_UNSPECIFIED = 0 + + # The KMS key is enabled and correctly configured. + ENABLED = 1 + + # Permission denied on the KMS key. + PERMISSION_DENIED = 2 + + # The KMS key is disabled. + DISABLED = 3 + + # The KMS key is destroyed. + DESTROYED = 4 + + # The KMS key is scheduled to be destroyed. + DESTROY_SCHEDULED = 5 + + # The EKM key is unreachable. + EKM_KEY_UNREACHABLE_DETECTED = 6 + + # Billing is disabled for the project. + BILLING_DISABLED = 7 + + # All other unknown failures. + UNKNOWN_FAILURE = 8 + end + end + + # Status of the PSC connection. + module PscConnectionStatus + # PSC connection status is not specified. + PSC_CONNECTION_STATUS_UNSPECIFIED = 0 + + # The connection is active + PSC_CONNECTION_STATUS_ACTIVE = 1 + + # Connection not found + PSC_CONNECTION_STATUS_NOT_FOUND = 2 + end + + # Available authorization mode of a Redis cluster. + module AuthorizationMode + # Not set. + AUTH_MODE_UNSPECIFIED = 0 + + # IAM basic authorization mode + AUTH_MODE_IAM_AUTH = 1 + + # Authorization disabled mode + AUTH_MODE_DISABLED = 2 + end + + # NodeType of a redis cluster node, + module NodeType + # Node type unspecified + NODE_TYPE_UNSPECIFIED = 0 + + # Redis shared core nano node_type. + REDIS_SHARED_CORE_NANO = 1 + + # Redis highmem medium node_type. + REDIS_HIGHMEM_MEDIUM = 2 + + # Redis highmem xlarge node_type. + REDIS_HIGHMEM_XLARGE = 3 + + # Redis standard small node_type. + REDIS_STANDARD_SMALL = 4 + end + + # Available mode of in-transit encryption. + module TransitEncryptionMode + # In-transit encryption not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 + + # In-transit encryption disabled. + TRANSIT_ENCRYPTION_MODE_DISABLED = 1 + + # Use server managed encryption for in-transit encryption. + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 + end + + # Type of a PSC connection, for cluster access purpose. + module ConnectionType + # Cluster endpoint Type is not set + CONNECTION_TYPE_UNSPECIFIED = 0 + + # Cluster endpoint that will be used as for cluster topology discovery. + CONNECTION_TYPE_DISCOVERY = 1 + + # Cluster endpoint that will be used as primary endpoint to access primary. + CONNECTION_TYPE_PRIMARY = 2 + + # Cluster endpoint that will be used as reader endpoint to access replicas. + CONNECTION_TYPE_READER = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/Gemfile new file mode 100644 index 000000000000..58f77436712d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1", path: "../" +else + gem "google-cloud-redis-cluster-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-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb new file mode 100644 index 000000000000..0c6ce0e1de7f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_BackupCluster_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the backup_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster. +# +def backup_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new + + # Call the backup_cluster method. + result = client.backup_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb new file mode 100644 index 000000000000..37f74452d46f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_CreateCluster_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the create_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb new file mode 100644 index 000000000000..763b06085393 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_DeleteBackup_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the delete_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb new file mode 100644 index 000000000000..80a345a291ab --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the delete_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb new file mode 100644 index 000000000000..3253a0b70a52 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_ExportBackup_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the export_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup. +# +def export_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new + + # Call the export_backup method. + result = client.export_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb new file mode 100644 index 000000000000..1a02a8ff4991 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_GetBackup_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the get_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. + p result +end +# [END redis_v1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb new file mode 100644 index 000000000000..62449b7b71ac --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the get_backup_collection call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection. +# +def get_backup_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new + + # Call the get_backup_collection method. + result = client.get_backup_collection request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. + p result +end +# [END redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb new file mode 100644 index 000000000000..4b0acdfbd4c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_GetCluster_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the get_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. + p result +end +# [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb new file mode 100644 index 000000000000..391b0074cc95 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority. +# +def get_cluster_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new + + # Call the get_cluster_certificate_authority method. + result = client.get_cluster_certificate_authority request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. + p result +end +# [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb new file mode 100644 index 000000000000..7ed3e74621d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the list_backup_collections call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections. +# +def list_backup_collections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new + + # Call the list_backup_collections method. + result = client.list_backup_collections request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. + p item + end +end +# [END redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb new file mode 100644 index 000000000000..a7bd15fac329 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_ListBackups_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the list_backups call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. + p item + end +end +# [END redis_v1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb new file mode 100644 index 000000000000..2d583522073c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_ListClusters_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the list_clusters call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. + p item + end +end +# [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb new file mode 100644 index 000000000000..7723a7a80948 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance. +# +def reschedule_cluster_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new + + # Call the reschedule_cluster_maintenance method. + result = client.reschedule_cluster_maintenance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb new file mode 100644 index 000000000000..8a3ba4936109 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] +require "google/cloud/redis/cluster/v1" + +## +# Snippet for the update_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json new file mode 100644 index 000000000000..01b74ba25300 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-redis-cluster-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.redis.cluster.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "redis_v1_generated_CloudRedisCluster_ListClusters_sync", + "title": "Snippet for the list_clusters call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters.", + "file": "cloud_redis_cluster/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::ListClustersResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListClusters", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_GetCluster_sync", + "title": "Snippet for the get_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster.", + "file": "cloud_redis_cluster/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::Cluster", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster.", + "file": "cloud_redis_cluster/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.UpdateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster.", + "file": "cloud_redis_cluster/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.DeleteCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster.", + "file": "cloud_redis_cluster/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.CreateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", + "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority.", + "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster_certificate_authority", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::CertificateAuthority", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetClusterCertificateAuthority", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetClusterCertificateAuthority", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", + "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", + "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_cluster_maintenance", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "RescheduleClusterMaintenance", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.RescheduleClusterMaintenance", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync", + "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections.", + "file": "cloud_redis_cluster/list_backup_collections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_collections", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackupCollections", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListBackupCollections", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync", + "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection.", + "file": "cloud_redis_cluster/get_backup_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_collection", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::BackupCollection", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackupCollection", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetBackupCollection", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_ListBackups_sync", + "title": "Snippet for the list_backups call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups.", + "file": "cloud_redis_cluster/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListBackups", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_GetBackup_sync", + "title": "Snippet for the get_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup.", + "file": "cloud_redis_cluster/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1::Backup", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup.", + "file": "cloud_redis_cluster/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.DeleteBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_ExportBackup_sync", + "title": "Snippet for the export_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup.", + "file": "cloud_redis_cluster/export_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ExportBackup", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ExportBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1_generated_CloudRedisCluster_BackupCluster_sync", + "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster.", + "file": "cloud_redis_cluster/backup_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "backup_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "BackupCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.BackupCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb new file mode 100644 index 000000000000..5d97788e0794 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb new file mode 100644 index 000000000000..1dfc3c812f64 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" + assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path + end + end + + def test_backup_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" + assert_equal "projects/value0/locations/value1/backupCollections/value2", path + end + end + + def test_certificate_authority_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_forwarding_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" + assert_equal "projects/value0/regions/value1/forwardingRules/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_service_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb new file mode 100644 index 000000000000..7814e81f54bf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb @@ -0,0 +1,873 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" + + +class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_get_cluster_certificate_authority + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::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_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_certificate_authority_client_stub.call_count + end + end + end + + def test_reschedule_cluster_maintenance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count + end + end + end + + def test_list_backup_collections + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_count + end + end + end + + def test_get_backup_collection + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_export_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_count + end + end + end + + def test_backup_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb new file mode 100644 index 000000000000..74b7da02c81c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb @@ -0,0 +1,1018 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::Cluster.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_rpc_count + end + end + + def test_get_cluster_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::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_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster_certificate_authority, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster_certificate_authority({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cluster_certificate_authority_client_stub.call_rpc_count + end + end + + def test_reschedule_cluster_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_cluster_maintenance, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_cluster_maintenance_client_stub.call_rpc_count + end + end + + def test_list_backup_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_collections, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_rpc_count + end + end + + def test_get_backup_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_collection, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup_collection({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1::Backup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_export_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, request + assert_equal "hello world", request["gcs_bucket"] + assert_equal :gcs_bucket, request.destination + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_rpc_count + end + end + + def test_backup_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :backup_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] + assert_equal "hello world", request["backup_id"] + assert request.has_backup_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..2ab1d03bbe46 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest", + "distribution_name": "google-cloud-redis-cluster-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis V1BETA1 API", + "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..fc0606d1c085 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-cluster-v1beta1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-redis-cluster-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts new file mode 100644 index 000000000000..599cfbea4d19 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud Memorystore for Redis V1BETA1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..9972a8b1c9f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-cluster-v1beta1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-redis-cluster-v1beta1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-redis-cluster-v1beta1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md new file mode 100644 index 000000000000..51dd0050463a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Google Cloud Memorystore for Redis V1BETA1 API + +Creates and manages Redis instances on the Google Cloud Platform. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Cloud Memorystore for Redis V1BETA1 API. Most users should consider using +the main client gem, +[google-cloud-redis-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-redis-cluster-v1beta1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/redis.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/redis/cluster/v1beta1" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new +request = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new # (request fields as keyword arguments...) +response = client.list_clusters request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/redis/cluster/v1beta1" +require "logger" + +client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-redis-cluster`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-cluster-v1beta1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-redis-cluster`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-redis-cluster-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile new file mode 100644 index 000000000000..ad063dcffe89 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-redis-cluster-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-redis-cluster-v1beta1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-cluster-v1beta1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-cluster-v1beta1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-redis-cluster-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-cluster-v1beta1" + header "google-cloud-redis-cluster-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-cluster-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-cluster-v1beta1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-redis-cluster-v1beta1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-redis-cluster-v1beta1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..1ecbc8224ac2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.redis.cluster.v1beta1", + "libraryPackage": "::Google::Cloud::Redis::Cluster::V1beta1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client", + "rpcs": { + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "GetClusterCertificateAuthority": { + "methods": [ + "get_cluster_certificate_authority" + ] + }, + "RescheduleClusterMaintenance": { + "methods": [ + "reschedule_cluster_maintenance" + ] + }, + "ListBackupCollections": { + "methods": [ + "list_backup_collections" + ] + }, + "GetBackupCollection": { + "methods": [ + "get_backup_collection" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ExportBackup": { + "methods": [ + "export_backup" + ] + }, + "BackupCluster": { + "methods": [ + "backup_cluster" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec new file mode 100644 index 000000000000..83483f0e982f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/cluster/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-cluster-v1beta1" + gem.version = Google::Cloud::Redis::Cluster::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." + gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.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-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb new file mode 100644 index 000000000000..d6ebeaed939f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/redis/cluster/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb new file mode 100644 index 000000000000..9a8dca3ac28b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" +require "google/cloud/redis/cluster/v1beta1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1beta1" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1beta1" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/redis/cluster/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb new file mode 100644 index 000000000000..e71d4e449670 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module Redis + module Cluster + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/redis/cluster/v1beta1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..23fc244f3f90 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/redis/cluster/v1beta1/version" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb new file mode 100644 index 000000000000..2c3aeac42e98 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb @@ -0,0 +1,1958 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/location" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + ## + # Client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @cloud_redis_cluster_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.cluster&.name + header_params["cluster.name"] = request.cluster.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :export_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.backup_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.call_rpc :backup_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudRedisCluster API. + # + # This class represents the configuration for CloudRedisCluster, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CloudRedisCluster API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb new file mode 100644 index 000000000000..95358ab0cf8d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Credentials for the CloudRedisCluster API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb new file mode 100644 index 000000000000..cef09e76cbb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb new file mode 100644 index 000000000000..4e928f81d245 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Path helper methods for the CloudRedisCluster API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup_collection:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupCollection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # + # @return [::String] + def backup_collection_path project:, location:, backup_collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" + end + + ## + # Create a fully-qualified CertificateAuthority resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def certificate_authority_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified ForwardingRule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` + # + # @param project [String] + # @param region [String] + # @param forwarding_rule [String] + # + # @return [::String] + def forwarding_rule_path project:, region:, forwarding_rule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified ServiceAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` + # + # @param project [String] + # @param region [String] + # @param service_attachment [String] + # + # @return [::String] + def service_attachment_path project:, region:, service_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb new file mode 100644 index 000000000000..9dcf91ae8976 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/redis/cluster/v1beta1/version" +require "google/cloud/redis/cluster/v1beta1/bindings_override" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + ## + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module CloudRedisCluster + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb new file mode 100644 index 000000000000..7506c3777984 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb @@ -0,0 +1,1825 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + ## + # REST client for the CloudRedisCluster service. + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_redis_cluster_stub + + ## + # Configure the CloudRedisCluster Client class. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudRedisCluster clients + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_clusters.timeout = 600.0 + + default_config.rpcs.get_cluster.timeout = 600.0 + + default_config.rpcs.update_cluster.timeout = 600.0 + + default_config.rpcs.delete_cluster.timeout = 600.0 + + default_config.rpcs.create_cluster.timeout = 600.0 + + default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 + + default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 + + default_config.rpcs.list_backup_collections.timeout = 600.0 + + default_config.rpcs.get_backup_collection.timeout = 600.0 + + default_config.rpcs.list_backups.timeout = 600.0 + + default_config.rpcs.get_backup.timeout = 600.0 + + default_config.rpcs.delete_backup.timeout = 600.0 + + default_config.rpcs.export_backup.timeout = 600.0 + + default_config.rpcs.backup_cluster.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_redis_cluster_stub.universe_domain + end + + ## + # Create a new CloudRedisCluster REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudRedisCluster client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_redis_cluster_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_redis_cluster_stub.logger + end + + # Service calls + + ## + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific Redis cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.update_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param cluster_id [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] + # Required. The cluster that is to be created. + # @param request_id [::String] + # Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.create_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of certificate authority information for Redis cluster. + # + # @overload get_cluster_certificate_authority(request, options = nil) + # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster_certificate_authority(name: nil) + # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + # + # # Call the get_cluster_certificate_authority method. + # result = client.get_cluster_certificate_authority request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + # p result + # + def get_cluster_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_cluster_certificate_authority request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_cluster_maintenance(request, options = nil) + # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + # + # # Call the reschedule_cluster_maintenance method. + # result = client.reschedule_cluster_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_cluster_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.reschedule_cluster_maintenance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.delete_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.export_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_cluster(request, options = nil) + # Pass arguments to `backup_cluster` via a request object, either of type + # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/redis/cluster/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + # + # # Call the backup_cluster method. + # result = client.backup_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.backup_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.backup_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_redis_cluster_stub.backup_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudRedisCluster REST API. + # + # This class represents the configuration for CloudRedisCluster REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudRedisCluster API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `get_cluster_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster_certificate_authority + ## + # RPC-specific configuration for `reschedule_cluster_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_cluster_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_cluster + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority + @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config + reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance + @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster + @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb new file mode 100644 index 000000000000..fb3b4d97dfa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb @@ -0,0 +1,926 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CloudRedisCluster Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudRedisCluster Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "redis.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb new file mode 100644 index 000000000000..0b4291c4ede3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb @@ -0,0 +1,942 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + module Rest + ## + # REST service stub for the CloudRedisCluster service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] + # A result object deserialized from the server's reply + def get_cluster_certificate_authority request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cluster_certificate_authority", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def reschedule_cluster_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "reschedule_cluster_maintenance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] + # A result object deserialized from the server's reply + def list_backup_collections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_collections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] + # A result object deserialized from the server's reply + def get_backup_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def export_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def backup_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "backup_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta1/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_cluster_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:rescheduleClusterMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_collections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/backupCollections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the backup_cluster REST call + # + # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_backup_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{name}:backup", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb new file mode 100644 index 000000000000..510cbcdbc9b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/any_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n.google.cloud.redis.cluster.v1beta1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12^\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1beta1.PscServiceAttachmentB\x03\xe0\x41\x03\x12S\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1beta1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12_\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12P\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xef\x01\n\tStateInfo\x12W\n\x0bupdate_info\x18\x01 \x01(\x0b\x32@.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x8f\x04\n\x15\x41utomatedBackupConfig\x12y\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32P.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12q\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x9b\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12I\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32..google.cloud.redis.cluster.v1beta1.BackupFileB\x03\xe0\x41\x03\x12\x44\n\tnode_type\x18\t \x01(\x0e\x32,.google.cloud.redis.cluster.v1beta1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12O\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x35.google.cloud.redis.cluster.v1beta1.Backup.BackupTypeB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\r \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1beta1.Backup.StateB\x03\xe0\x41\x03\x12P\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x89\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x92\x07\n\x1d\x43rossClusterReplicationConfig\x12\x63\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole\x12h\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12k\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\nmembership\x18\x05 \x01(\x0b\x32L.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xed\x01\n\nMembership\x12m\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12p\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xed\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32\x42.google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x84\x01\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x46\n\npsc_config\x18\x03 \x01(\x0b\x32-.google.cloud.redis.cluster.v1beta1.PscConfigB\x03\xe0\x41\x03\"\xe4\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\\\n\x0f\x43lusterEndpoint\x12I\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x34.google.cloud.redis.cluster.v1beta1.ConnectionDetail\"\xc3\x01\n\x10\x43onnectionDetail\x12T\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1beta1.PscAutoConnectionH\x00\x12K\n\x0epsc_connection\x18\x02 \x01(\x0b\x32\x31.google.cloud.redis.cluster.v1beta1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xe8\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x8f\x04\n\x14\x43\x65rtificateAuthority\x12q\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32T.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xb2\x01\n\x1bManagedCertificateAuthority\x12p\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32^.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\xa0\x07\n\x18\x43lusterPersistenceConfig\x12_\n\x04mode\x18\x01 \x01(\x0e\x32L.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12_\n\nrdb_config\x18\x02 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12_\n\naof_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xbf\x02\n\tRDBConfig\x12w\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32U.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc9\x01\n\tAOFConfig\x12m\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32R.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xf0\x01\n\x16ZoneDistributionConfig\x12\x62\n\x04mode\x18\x01 \x01(\x0e\x32O.google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xdc\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12t\n\x0freschedule_type\x18\x02 \x01(\x0e\x32V.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\x84\x05\n\x0e\x45ncryptionInfo\x12U\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x62\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32>.google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\xc4\x19\n\x11\x43loudRedisCluster\x12\xc5\x01\n\x0cListClusters\x12\x37.google.cloud.redis.cluster.v1beta1.ListClustersRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.ListClustersResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/clusters\x12\xb2\x01\n\nGetCluster\x12\x35.google.cloud.redis.cluster.v1beta1.GetClusterRequest\x1a+.google.cloud.redis.cluster.v1beta1.Cluster\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xec\x01\n\rUpdateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xd9\x01\n\rDeleteCluster\x12\x38.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xe9\x01\n\rCreateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xfc\x01\n\x1eGetClusterCertificateAuthority\x12I.google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.CertificateAuthority\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1beta1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\xa8\x02\n\x1cRescheduleClusterMaintenance\x12G.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xe9\x01\n\x15ListBackupCollections\x12@.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest\x1a\x41.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/backupCollections\x12\xd6\x01\n\x13GetBackupCollection\x12>.google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest\x1a\x34.google.cloud.redis.cluster.v1beta1.BackupCollection\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{name=projects/*/locations/*/backupCollections/*}\x12\xd5\x01\n\x0bListBackups\x12\x36.google.cloud.redis.cluster.v1beta1.ListBackupsRequest\x1a\x37.google.cloud.redis.cluster.v1beta1.ListBackupsResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xc2\x01\n\tGetBackup\x12\x34.google.cloud.redis.cluster.v1beta1.GetBackupRequest\x1a*.google.cloud.redis.cluster.v1beta1.Backup\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xeb\x01\n\x0c\x44\x65leteBackup\x12\x37.google.cloud.redis.cluster.v1beta1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xde\x01\n\x0c\x45xportBackup\x12\x37.google.cloud.redis.cluster.v1beta1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02P\"K/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xd5\x01\n\rBackupCluster\x12\x38.google.cloud.redis.cluster.v1beta1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8e\x06\n&com.google.cloud.redis.cluster.v1beta1B\x16\x43loudRedisClusterProtoP\x01Z@cloud.google.com/go/redis/cluster/apiv1beta1/clusterpb;clusterpb\xea\x02&Google::Cloud::Redis::Cluster::V1beta1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +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.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.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 Cluster + module V1beta1 + CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CreateClusterRequest").msgclass + ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersRequest").msgclass + ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersResponse").msgclass + UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.UpdateClusterRequest").msgclass + GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterRequest").msgclass + DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteClusterRequest").msgclass + GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest").msgclass + ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest").msgclass + ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse").msgclass + GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsResponse").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupRequest").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteBackupRequest").msgclass + ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ExportBackupRequest").msgclass + BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupClusterRequest").msgclass + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster").msgclass + Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo").msgclass + Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo").msgclass + Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.GcsBackupSource").msgclass + Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.ManagedBackupSource").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.State").enummodule + AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig").msgclass + AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass + AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupMode").enummodule + BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupCollection").msgclass + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup").msgclass + Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.BackupType").enummodule + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.State").enummodule + BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupFile").msgclass + PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscServiceAttachment").msgclass + CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig").msgclass + CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster").msgclass + CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.Membership").msgclass + CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole").enummodule + ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenancePolicy").msgclass + ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow").msgclass + ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenanceSchedule").msgclass + PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConfig").msgclass + DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint").msgclass + PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnection").msgclass + ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterEndpoint").msgclass + ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionDetail").msgclass + PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscAutoConnection").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.OperationMetadata").msgclass + CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority").msgclass + CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass + ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig").msgclass + ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig").msgclass + ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule + ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig").msgclass + ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule + ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceMode").enummodule + ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig").msgclass + ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionMode").enummodule + RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest").msgclass + RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.Type").enummodule + EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyState").enummodule + PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnectionStatus").enummodule + AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AuthorizationMode").enummodule + NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.NodeType").enummodule + TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.TransitEncryptionMode").enummodule + ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionType").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb new file mode 100644 index 000000000000..1c3cba0b9031 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb @@ -0,0 +1,122 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.V1beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb' + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + module CloudRedisCluster + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.redis.cluster.v1beta1.CloudRedisCluster' + + # Lists all Redis clusters owned by a project in either the specified + # location (region) or all locations. + # + # The location should have the following format: + # + # * `projects/{project_id}/locations/{location_id}` + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse + # Gets the details of a specific Redis cluster. + rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Cluster + # Updates the metadata and configuration of a specific Redis cluster. + # + # Completed longrunning.Operation will contain the new cluster object + # in the response field. The returned operation is automatically deleted + # after a few hours, so there is no need to call DeleteOperation. + rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Google::Longrunning::Operation + # Deletes a specific Redis cluster. Cluster stops serving and data is + # deleted. + rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Google::Longrunning::Operation + # Creates a Redis cluster based on the specified properties. + # The creation is executed asynchronously and callers may check the returned + # operation to track its progress. Once the operation is completed the Redis + # cluster will be fully functional. The completed longrunning.Operation will + # contain the new cluster object in the response field. + # + # The returned operation is automatically deleted after a few hours, so there + # is no need to call DeleteOperation. + rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Google::Longrunning::Operation + # Gets the details of certificate authority information for Redis cluster. + rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority + # Reschedules upcoming maintenance event. + rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse + # Get a backup collection. + rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection + # Lists all backups owned by a backup collection. + rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse + # Gets the details of a specific backup. + rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Backup + # Deletes a specific backup. + rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Google::Longrunning::Operation + # Exports a specific backup to a customer target Cloud Storage URI. + rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Google::Longrunning::Operation + # Backup Redis Cluster. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the cluster's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb new file mode 100644 index 000000000000..8c0c0259da61 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" +require "google/cloud/redis/cluster/v1beta1/bindings_override" +require "google/cloud/redis/cluster/v1beta1/version" + +module Google + module Cloud + module Redis + module Cluster + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/redis/cluster/v1beta1/rest" + # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new + # + module V1beta1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb new file mode 100644 index 000000000000..5aa210ce32bc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..fdace2b045a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud Memorystore for Redis V1BETA1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb new file mode 100644 index 000000000000..1a25774de845 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb @@ -0,0 +1,1301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Redis + module Cluster + module V1beta1 + # Request for [CreateCluster][CloudRedis.CreateCluster]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The logical name of the Redis cluster in the customer project + # with the following restrictions: + # + # * Must contain only lowercase letters, numbers, and hyphens. + # * Must start with a letter. + # * Must be between 1-63 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project / location + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # Required. The cluster that is to be created. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster location using the form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The `next_page_token` value returned from a previous + # [ListClusters][CloudRedis.ListClusters] request, if any. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListClusters][CloudRedis.ListClusters]. + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] + # A list of Redis clusters in the project in the specified location, + # or across all locations. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # Redis entry is included in the response with the `name` field set to a + # value of the form + # `projects/{project_id}/locations/{location_id}/clusters/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListClusters". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [UpdateCluster][CloudRedis.UpdateCluster]. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask of fields to update. At least one path must be supplied in + # this field. The elements of the repeated paths field may only include these + # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: + # + # * `size_gb` + # * `replica_count` + # @!attribute [rw] cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] + # Required. Update description. + # Only fields specified in update_mask are updated. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetCluster][CloudRedis.GetCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteCluster][CloudRedis.DeleteCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster certificate authority resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` + # where `location_id` refers to a GCP region. + class GetClusterCertificateAuthorityRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackupCollections] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupCollectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackupCollections]. + # @!attribute [rw] backup_collections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] + # A list of backupCollections in the project. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # backupCollection entry is included in the response with the `name` field + # set to a value of the form + # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListBackupCollections". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupCollectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackupCollection]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a GCP region. + class GetBackupCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ListBackups]. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # [ListBackupCollections] request, if any. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [ListBackups]. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] + # A list of backups in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Backups that could not be reached. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [GetBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [DeleteBackup]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Idempotent request UUID. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [ExportBackup]. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @!attribute [rw] name + # @return [::String] + # Required. Redis backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class ExportBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [BackupCluster]. + # @!attribute [rw] name + # @return [::String] + # Required. Redis cluster resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @!attribute [rw] backup_id + # @return [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. + class BackupClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cluster instance. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::GcsBackupSource] + # Optional. Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # Read permission is required to import from the provided Cloud Storage + # objects. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] managed_backup_source + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::ManagedBackupSource] + # Optional. Backups generated and managed by memorystore service. + # + # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. Identifier. Unique name of the resource in this scope including + # project and location using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp associated with the cluster creation request. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::State] + # Output only. The current state of this cluster. + # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned, unique identifier for the cluster. + # @!attribute [rw] replica_count + # @return [::Integer] + # Optional. The number of replica nodes per shard. + # @!attribute [rw] authorization_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AuthorizationMode] + # Optional. The authorization mode of the Redis cluster. + # If not provided, auth feature is disabled for the cluster. + # @!attribute [rw] transit_encryption_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::TransitEncryptionMode] + # Optional. The in-transit encryption for the Redis cluster. + # If not provided, encryption is disabled for the cluster. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Redis memory size in GB for the entire cluster rounded up to + # the next integer. + # @!attribute [rw] shard_count + # @return [::Integer] + # Optional. Number of shards for the Redis cluster. + # @!attribute [rw] psc_configs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConfig>] + # Optional. Each PscConfig configures the consumer network where IPs will + # be designated to the cluster for client access through Private Service + # Connect Automation. Currently, only one PscConfig is supported. + # @!attribute [r] discovery_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::DiscoveryEndpoint>] + # Output only. Endpoints created on each given network, for Redis clients to + # connect to the cluster. Currently only one discovery endpoint is supported. + # @!attribute [r] psc_connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConnection>] + # Output only. The list of PSC connections that are auto-created through + # service connectivity automation. + # @!attribute [r] state_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo] + # Output only. Additional information about the current state of the cluster. + # @!attribute [rw] node_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] + # Optional. The type of a redis node in the cluster. NodeType determines the + # underlying machine-type of a redis node. + # @!attribute [rw] persistence_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig] + # Optional. Persistence config (RDB, AOF) for the cluster. + # @!attribute [rw] redis_configs + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Key/Value pairs of customer overrides for mutable Redis Configs + # @!attribute [r] precise_size_gb + # @return [::Float] + # Output only. Precise value of redis memory size in GB for the entire + # cluster. + # @!attribute [rw] zone_distribution_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig] + # Optional. This config will be used to determine how the customer wants us + # to distribute cluster resources within the region. + # @!attribute [rw] cross_cluster_replication_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig] + # Optional. Cross cluster replication config. + # @!attribute [rw] deletion_protection_enabled + # @return [::Boolean] + # Optional. The delete operation will fail when the value is set to true. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenancePolicy] + # Optional. ClusterMaintenancePolicy determines when to allow or deny + # updates. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenanceSchedule] + # Output only. ClusterMaintenanceSchedule Output only Published maintenance + # schedule. + # @!attribute [r] psc_service_attachments + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscServiceAttachment>] + # Output only. Service attachment details to configure Psc connections + # @!attribute [rw] cluster_endpoints + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterEndpoint>] + # Optional. A list of cluster enpoints. + # @!attribute [r] backup_collection + # @return [::String] + # Optional. Output only. The backup collection full resource name. Example: + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} + # @!attribute [rw] kms_key + # @return [::String] + # Optional. The KMS key used to encrypt the at-rest data of the cluster. + # @!attribute [rw] automated_backup_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig] + # Optional. The automated backup config for the cluster. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] + # Output only. Encryption information of the data at rest of the cluster. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents additional information about the state of the cluster. + # @!attribute [rw] update_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo::UpdateInfo] + # Describes ongoing update on the cluster when cluster state is UPDATING. + class StateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents information about an updating cluster. + # @!attribute [rw] target_shard_count + # @return [::Integer] + # Target number of shards for redis cluster + # @!attribute [rw] target_replica_count + # @return [::Integer] + # Target number of replica nodes per shard. + class UpdateInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Backups stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the clusters. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Optional. URIs of the GCS objects to import. + # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 + class GcsBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backups that generated and managed by memorystore. + # @!attribute [rw] backup + # @return [::String] + # Optional. Example: + # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} + # A shorter version (without the prefix) of the backup name is also + # supported, like + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} + # In this case, it assumes the backup is under redis.googleapis.com. + class ManagedBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RedisConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states of a Redis cluster. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # Redis cluster is being created. + CREATING = 1 + + # Redis cluster has been created and is fully usable. + ACTIVE = 2 + + # Redis cluster configuration is being updated. + UPDATING = 3 + + # Redis cluster is being deleted. + DELETING = 4 + end + end + + # The automated backup config for a cluster. + # @!attribute [rw] fixed_frequency_schedule + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::FixedFrequencySchedule] + # Optional. Trigger automated backups at a fixed frequency. + # @!attribute [rw] automated_backup_mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::AutomatedBackupMode] + # Optional. The automated backup mode. If the mode is disabled, the other + # fields will be ignored. + # @!attribute [rw] retention + # @return [::Google::Protobuf::Duration] + # Optional. How long to keep automated backups before the backups are + # deleted. The value should be between 1 day and 365 days. If not specified, + # the default value is 35 days. + class AutomatedBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This schedule allows the backup to be triggered at a fixed frequency + # (currently only daily is supported). + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. The start time of every automated backup in UTC. It must be set + # to the start of an hour. This field is required. + class FixedFrequencySchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The automated backup mode. + module AutomatedBackupMode + # Default value. Automated backup config is not specified. + AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 + + # Automated backup config disabled. + DISABLED = 1 + + # Automated backup config enabled. + ENABLED = 2 + end + end + + # BackupCollection of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup collection. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The cluster uid of the backup collection. + # @!attribute [r] cluster + # @return [::String] + # Output only. The full resource path of the cluster the backup collection + # belongs to. Example: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @!attribute [r] kms_key + # @return [::String] + # Output only. The KMS key used to encrypt the backups under this backup + # collection. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup collection. + class BackupCollection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup of a cluster. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup. the last part of the name is + # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster + # UID] OR customer specified while backup cluster. Example: + # 20240515123000_1234 + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup was created. + # @!attribute [r] cluster + # @return [::String] + # Output only. Cluster resource path of this backup. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. Cluster uid of this backup. + # @!attribute [r] total_size_bytes + # @return [::Integer] + # Output only. Total size of the backup in bytes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup will expire. + # @!attribute [r] engine_version + # @return [::String] + # Output only. redis-7.2, valkey-7.5 + # @!attribute [r] backup_files + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupFile>] + # Output only. List of backup files of the backup. + # @!attribute [r] node_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] + # Output only. Node type of the cluster. + # @!attribute [r] replica_count + # @return [::Integer] + # Output only. Number of replicas for the cluster. + # @!attribute [r] shard_count + # @return [::Integer] + # Output only. Number of shards for the cluster. + # @!attribute [r] backup_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::BackupType] + # Output only. Type of the backup. + # @!attribute [r] state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::State] + # Output only. State of the backup. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] + # Output only. Encryption information of the backup. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the backup. + module BackupType + # The default value, not set. + BACKUP_TYPE_UNSPECIFIED = 0 + + # On-demand backup. + ON_DEMAND = 1 + + # Automated backup. + AUTOMATED = 2 + end + + # State of the backup. + module State + # The default value, not set. + STATE_UNSPECIFIED = 0 + + # The backup is being created. + CREATING = 1 + + # The backup is active to be used. + ACTIVE = 2 + + # The backup is being deleted. + DELETING = 3 + + # The backup is currently suspended due to reasons like project deletion, + # billing account closure, etc. + SUSPENDED = 4 + end + end + + # Backup is consisted of multiple backup files. + # @!attribute [r] file_name + # @return [::String] + # Output only. e.g: .rdb + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Size of the backup file in bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup file was created. + class BackupFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of a service attachment of the cluster, for creating PSC + # connections. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. Service attachment URI which your self-created PscConnection + # should use as target + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of a PSC connection targeting this service attachment. + class PscServiceAttachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cross cluster replication config. + # @!attribute [rw] cluster_role + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::ClusterRole] + # The role of the cluster in cross cluster replication. + # @!attribute [rw] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] + # Details of the primary cluster that is used as the replication source for + # this secondary cluster. + # + # This field is only set for a secondary cluster. + # @!attribute [rw] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] + # List of secondary clusters that are replicating from this primary cluster. + # + # This field is only set for a primary cluster. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time cross cluster replication config was updated. + # @!attribute [r] membership + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::Membership] + # Output only. An output only view of all the member clusters participating + # in the cross cluster replication. This view will be provided by every + # member cluster irrespective of its cluster role(primary or secondary). + # + # A primary cluster can provide information about all the secondary clusters + # replicating from it. However, a secondary cluster only knows about the + # primary cluster from which it is replicating. However, for scenarios, where + # the primary cluster is unavailable(e.g. regional outage), a GetCluster + # request can be sent to any other member cluster and this field will list + # all the member clusters participating in cross cluster replication. + class CrossClusterReplicationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details of the remote cluster associated with this cluster in a cross + # cluster replication setup. + # @!attribute [rw] cluster + # @return [::String] + # The full resource path of the remote cluster in + # the format: projects//locations//clusters/ + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the remote cluster. + class RemoteCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An output only view of all the member clusters participating in the cross + # cluster replication. + # @!attribute [r] primary_cluster + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] + # Output only. The primary cluster that acts as the source of replication + # for the secondary clusters. + # @!attribute [r] secondary_clusters + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] + # Output only. The list of secondary clusters replicating from the primary + # cluster. + class Membership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The role of the cluster in cross cluster replication. + module ClusterRole + # Cluster role is not set. + # The behavior is equivalent to NONE. + CLUSTER_ROLE_UNSPECIFIED = 0 + + # This cluster does not participate in cross cluster replication. It is an + # independent cluster and does not replicate to or from any other clusters. + NONE = 1 + + # A cluster that allows both reads and writes. Any data written to this + # cluster is also replicated to the attached secondary clusters. + PRIMARY = 2 + + # A cluster that allows only reads and replicates data from a primary + # cluster. + SECONDARY = 3 + end + end + + # Maintenance policy per cluster. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created i.e. Maintenance Window + # or Deny Period was assigned. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated i.e. Maintenance Window + # or Deny Period was updated. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterWeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_maintenance_window is expected to be one. + class ClusterMaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Start time of the window in UTC. + class ClusterWeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maitenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this + # instance. + class ClusterMaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] network + # @return [::String] + # Required. The network where the IP address of the discovery endpoint will + # be reserved, in the form of + # projects/\\{network_project}/global/networks/\\{network_id}. + class PscConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpoints on each network, for Redis clients to connect to the cluster. + # @!attribute [r] address + # @return [::String] + # Output only. Address of the exposed Redis endpoint used by clients to + # connect to the service. The address could be either IP or hostname. + # @!attribute [r] port + # @return [::Integer] + # Output only. The port number of the exposed Redis endpoint. + # @!attribute [r] psc_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConfig] + # Output only. Customer configuration for where the endpoint is created and + # accessed from. + class DiscoveryEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection. + # @!attribute [rw] psc_connection_id + # @return [::String] + # Required. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [rw] address + # @return [::String] + # Required. The IP allocated on the consumer network for the PSC forwarding + # rule. + # @!attribute [rw] forwarding_rule + # @return [::String] + # Required. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Optional. Project ID of the consumer project where the forwarding rule is + # created in. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [rw] service_attachment + # @return [::String] + # Required. The service attachment which is the target of the PSC connection, + # in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # To get the latest status of a PSC connection, follow + # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of the PSC connection. + class PscConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ClusterEndpoint consists of PSC connections that are created + # as a group in each VPC network for accessing the cluster. In each group, + # there shall be one connection for each service attachment in the cluster. + # @!attribute [rw] connections + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ConnectionDetail>] + # A group of PSC connections. They are created in the same VPC network, one + # for each service attachment in the cluster. + class ClusterEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed information of each PSC connection. + # @!attribute [rw] psc_auto_connection + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscAutoConnection] + # Detailed information of a PSC connection that is created through + # service connectivity automation. + # + # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] psc_connection + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnection] + # Detailed information of a PSC connection that is created by the customer + # who owns the cluster. + # + # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ConnectionDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of consumer resources in a PSC connection that is created through + # Service Connectivity Automation. + # @!attribute [r] psc_connection_id + # @return [::String] + # Output only. The PSC connection id of the forwarding rule connected to the + # service attachment. + # @!attribute [r] address + # @return [::String] + # Output only. The IP allocated on the consumer network for the PSC + # forwarding rule. + # @!attribute [r] forwarding_rule + # @return [::String] + # Output only. The URI of the consumer side forwarding rule. + # Example: + # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. + # @!attribute [rw] project_id + # @return [::String] + # Required. The consumer project_id where the forwarding rule is created + # from. + # @!attribute [rw] network + # @return [::String] + # Required. The consumer network where the IP address resides, in the form of + # projects/\\{project_id}/global/networks/\\{network_id}. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. The service attachment which is the target of the PSC + # connection, in the form of + # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. + # @!attribute [r] psc_connection_status + # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] + # Output only. The status of the PSC connection. + # Please note that this value is updated periodically. + # Please use Private Service Connect APIs for the latest status. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] + # Output only. Type of the PSC connection. + class PscAutoConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pre-defined metadata fields. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Redis cluster certificate authority + # @!attribute [rw] managed_server_ca + # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority] + # @!attribute [rw] name + # @return [::String] + # Identifier. Unique name of the resource in this scope including project, + # location and cluster using the form: + # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` + class CertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] ca_certs + # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] + # The PEM encoded CA certificate chains for redis managed + # server authentication + class ManagedCertificateAuthority + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] certificates + # @return [::Array<::String>] + # The certificates that form the CA chain, from leaf to root order. + class CertChain + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration of the persistence functionality. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::PersistenceMode] + # Optional. The mode of persistence. + # @!attribute [rw] rdb_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig] + # Optional. RDB configuration. This field will be ignored if mode is not RDB. + # @!attribute [rw] aof_config + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig] + # Optional. AOF configuration. This field will be ignored if mode is not AOF. + class ClusterPersistenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of the RDB based persistence. + # @!attribute [rw] rdb_snapshot_period + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] + # Optional. Period between RDB snapshots. + # @!attribute [rw] rdb_snapshot_start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time that the first snapshot was/will be attempted, and to + # which future snapshots will be aligned. If not provided, the current time + # will be used. + class RDBConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available snapshot periods. + module SnapshotPeriod + # Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0 + + # One hour. + ONE_HOUR = 1 + + # Six hours. + SIX_HOURS = 2 + + # Twelve hours. + TWELVE_HOURS = 3 + + # Twenty four hours. + TWENTY_FOUR_HOURS = 4 + end + end + + # Configuration of the AOF based persistence. + # @!attribute [rw] append_fsync + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig::AppendFsync] + # Optional. fsync configuration. + class AOFConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Available fsync modes. + module AppendFsync + # Not set. Default: EVERYSEC + APPEND_FSYNC_UNSPECIFIED = 0 + + # Never fsync. Normally Linux will flush data every 30 seconds with this + # configuration, but it's up to the kernel's exact tuning. + NO = 1 + + # fsync every second. Fast enough, and you may lose 1 second of data if + # there is a disaster + EVERYSEC = 2 + + # fsync every time new write commands are appended to the AOF. It has the + # best data loss protection at the cost of performance + ALWAYS = 3 + end + end + + # Available persistence modes. + module PersistenceMode + # Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0 + + # Persistence is disabled, and any snapshot data is deleted. + DISABLED = 1 + + # RDB based persistence is enabled. + RDB = 2 + + # AOF based persistence is enabled. + AOF = 3 + end + end + + # Zone distribution config for allocation of cluster resources. + # @!attribute [rw] mode + # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig::ZoneDistributionMode] + # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not + # specified. + # @!attribute [rw] zone + # @return [::String] + # Optional. When SINGLE ZONE distribution is selected, zone field would be + # used to allocate all resources in that zone. This is not applicable to + # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. + class ZoneDistributionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines various modes of zone distribution. + module ZoneDistributionMode + # Not Set. Default: MULTI_ZONE + ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 + + # Distribute all resources across 3 zones picked at random, within the + # region. + MULTI_ZONE = 1 + + # Distribute all resources in a single zone. The zone field must be + # specified, when this mode is selected. + SINGLE_ZONE = 2 + end + end + + # Request for rescheduling a cluster maintenance. + # @!attribute [rw] name + # @return [::String] + # Required. Redis Cluster instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as + # well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleClusterMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # EncryptionInfo describes the encryption information of a cluster or a backup. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::Type] + # Output only. Type of encryption. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Output only. KMS key versions that are being used to protect the data + # at-rest. + # @!attribute [r] kms_key_primary_state + # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::KmsKeyState] + # Output only. The state of the primary version of the KMS key perceived by + # the system. This field is not populated in backups. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time when the encryption info was updated. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is fully managed by Google. + # No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1 + + # The data is encrypted at rest with a key that is managed by the customer. + # KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + + # The state of the KMS key perceived by the system. Refer to the public + # documentation for the impact of each state. + module KmsKeyState + # The default value. This value is unused. + KMS_KEY_STATE_UNSPECIFIED = 0 + + # The KMS key is enabled and correctly configured. + ENABLED = 1 + + # Permission denied on the KMS key. + PERMISSION_DENIED = 2 + + # The KMS key is disabled. + DISABLED = 3 + + # The KMS key is destroyed. + DESTROYED = 4 + + # The KMS key is scheduled to be destroyed. + DESTROY_SCHEDULED = 5 + + # The EKM key is unreachable. + EKM_KEY_UNREACHABLE_DETECTED = 6 + + # Billing is disabled for the project. + BILLING_DISABLED = 7 + + # All other unknown failures. + UNKNOWN_FAILURE = 8 + end + end + + # Status of the PSC connection. + module PscConnectionStatus + # PSC connection status is not specified. + PSC_CONNECTION_STATUS_UNSPECIFIED = 0 + + # The connection is active + PSC_CONNECTION_STATUS_ACTIVE = 1 + + # Connection not found + PSC_CONNECTION_STATUS_NOT_FOUND = 2 + end + + # Available authorization mode of a Redis cluster. + module AuthorizationMode + # Not set. + AUTH_MODE_UNSPECIFIED = 0 + + # IAM basic authorization mode + AUTH_MODE_IAM_AUTH = 1 + + # Authorization disabled mode + AUTH_MODE_DISABLED = 2 + end + + # NodeType of a redis cluster node, + module NodeType + # Node type unspecified + NODE_TYPE_UNSPECIFIED = 0 + + # Redis shared core nano node_type. + REDIS_SHARED_CORE_NANO = 1 + + # Redis highmem medium node_type. + REDIS_HIGHMEM_MEDIUM = 2 + + # Redis highmem xlarge node_type. + REDIS_HIGHMEM_XLARGE = 3 + + # Redis standard small node_type. + REDIS_STANDARD_SMALL = 4 + end + + # Available mode of in-transit encryption. + module TransitEncryptionMode + # In-transit encryption not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 + + # In-transit encryption disabled. + TRANSIT_ENCRYPTION_MODE_DISABLED = 1 + + # Use server managed encryption for in-transit encryption. + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 + end + + # Type of a PSC connection, for cluster access purpose. + module ConnectionType + # Cluster endpoint Type is not set + CONNECTION_TYPE_UNSPECIFIED = 0 + + # Cluster endpoint that will be used as for cluster topology discovery. + CONNECTION_TYPE_DISCOVERY = 1 + + # Cluster endpoint that will be used as primary endpoint to access primary. + CONNECTION_TYPE_PRIMARY = 2 + + # Cluster endpoint that will be used as reader endpoint to access replicas. + CONNECTION_TYPE_READER = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..df35534a4e02 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-redis-cluster-v1beta1", path: "../" +else + gem "google-cloud-redis-cluster-v1beta1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb new file mode 100644 index 000000000000..bf5ebfcda30d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the backup_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster. +# +def backup_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new + + # Call the backup_cluster method. + result = client.backup_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb new file mode 100644 index 000000000000..7638244dba94 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the create_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb new file mode 100644 index 000000000000..19917b30490c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the delete_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb new file mode 100644 index 000000000000..fbc95553d4b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the delete_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb new file mode 100644 index 000000000000..5ab68f801603 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the export_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup. +# +def export_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new + + # Call the export_backup method. + result = client.export_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb new file mode 100644 index 000000000000..7db2d5eecb49 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_backup call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb new file mode 100644 index 000000000000..766299664331 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_backup_collection call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection. +# +def get_backup_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new + + # Call the get_backup_collection method. + result = client.get_backup_collection request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb new file mode 100644 index 000000000000..77e8fff246f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb new file mode 100644 index 000000000000..e5b88a2ead35 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority. +# +def get_cluster_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new + + # Call the get_cluster_certificate_authority method. + result = client.get_cluster_certificate_authority request + + # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. + p result +end +# [END redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb new file mode 100644 index 000000000000..ad3986e233a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_backup_collections call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections. +# +def list_backup_collections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new + + # Call the list_backup_collections method. + result = client.list_backup_collections request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb new file mode 100644 index 000000000000..cd01f47c1522 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_backups call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb new file mode 100644 index 000000000000..eecf60935fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the list_clusters call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. + p item + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb new file mode 100644 index 000000000000..0f6991ad3882 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance. +# +def reschedule_cluster_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new + + # Call the reschedule_cluster_maintenance method. + result = client.reschedule_cluster_maintenance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb new file mode 100644 index 000000000000..d626b00ee718 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] +require "google/cloud/redis/cluster/v1beta1" + +## +# Snippet for the update_cluster call in the CloudRedisCluster service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json new file mode 100644 index 000000000000..7e3369688058 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json @@ -0,0 +1,575 @@ +{ + "client_library": { + "name": "google-cloud-redis-cluster-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.redis.cluster.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync", + "title": "Snippet for the list_clusters call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters.", + "file": "cloud_redis_cluster/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListClusters", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync", + "title": "Snippet for the get_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster.", + "file": "cloud_redis_cluster/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Cluster", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster.", + "file": "cloud_redis_cluster/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.UpdateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster.", + "file": "cloud_redis_cluster/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster.", + "file": "cloud_redis_cluster/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.CreateCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", + "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority.", + "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster_certificate_authority", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetClusterCertificateAuthority", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetClusterCertificateAuthority", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", + "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", + "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_cluster_maintenance", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "RescheduleClusterMaintenance", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.RescheduleClusterMaintenance", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync", + "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections.", + "file": "cloud_redis_cluster/list_backup_collections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_collections", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackupCollections", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackupCollections", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync", + "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection.", + "file": "cloud_redis_cluster/get_backup_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_collection", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackupCollection", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackupCollection", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync", + "title": "Snippet for the list_backups call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups.", + "file": "cloud_redis_cluster/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackups", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync", + "title": "Snippet for the get_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup.", + "file": "cloud_redis_cluster/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Backup", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup.", + "file": "cloud_redis_cluster/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync", + "title": "Snippet for the export_backup call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup.", + "file": "cloud_redis_cluster/export_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_backup", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "ExportBackup", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ExportBackup", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync", + "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster.", + "file": "cloud_redis_cluster/backup_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "backup_cluster", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudRedisCluster::Client", + "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" + }, + "method": { + "short_name": "BackupCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.BackupCluster", + "service": { + "short_name": "CloudRedisCluster", + "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb new file mode 100644 index 000000000000..7d3baf4c1ca7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb new file mode 100644 index 000000000000..26bfd76d5d1c --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" + assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path + end + end + + def test_backup_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" + assert_equal "projects/value0/locations/value1/backupCollections/value2", path + end + end + + def test_certificate_authority_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_forwarding_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" + assert_equal "projects/value0/regions/value1/forwardingRules/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_service_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb new file mode 100644 index 000000000000..906ca29bdc78 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb @@ -0,0 +1,873 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" + + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_get_cluster_certificate_authority + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_certificate_authority_client_stub.call_count + end + end + end + + def test_reschedule_cluster_maintenance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count + end + end + end + + def test_list_backup_collections + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_count + end + end + end + + def test_get_backup_collection + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_export_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_count + end + end + end + + def test_backup_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb new file mode 100644 index 000000000000..5699b33b9472 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb @@ -0,0 +1,1018 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" +require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" + +class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_rpc_count + end + end + + def test_get_cluster_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster_certificate_authority, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster_certificate_authority({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cluster_certificate_authority_client_stub.call_rpc_count + end + end + + def test_reschedule_cluster_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_cluster_maintenance, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_cluster_maintenance_client_stub.call_rpc_count + end + end + + def test_list_backup_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_collections, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_rpc_count + end + end + + def test_get_backup_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_collection, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup_collection({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_export_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_backup, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, request + assert_equal "hello world", request["gcs_bucket"] + assert_equal :gcs_bucket, request.destination + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_rpc_count + end + end + + def test_backup_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :backup_cluster, name + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] + assert_equal "hello world", request["backup_id"] + assert request.has_backup_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, backup_cluster_client_stub do + # Create client + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, backup_cluster_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster-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-cluster/.gitignore b/owl-bot-staging/google-cloud-redis-cluster/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json new file mode 100644 index 000000000000..a4eacf09bd79 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "redis.googleapis.com", + "api_shortname": "redis", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster/latest", + "distribution_name": "google-cloud-redis-cluster", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis API", + "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform.", + "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml new file mode 100644 index 000000000000..fb84f9ce2d5d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis-cluster.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-cluster.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/.yardopts b/owl-bot-staging/google-cloud-redis-cluster/.yardopts new file mode 100644 index 000000000000..99a35e32f21f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/.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-cluster/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md new file mode 100644 index 000000000000..b6045d2796c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis-cluster library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-redis-cluster library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/redis/cluster" + +client = Google::Cloud::Redis::Cluster.cloud_redis_cluster do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis/cluster" + +Google::Cloud::Redis::Cluster.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Redis::Cluster.cloud_redis_cluster +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-redis-cluster +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/redis/cluster" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Redis::Cluster.cloud_redis_cluster +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis-cluster/Gemfile b/owl-bot-staging/google-cloud-redis-cluster/Gemfile new file mode 100644 index 000000000000..246777aa5664 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-redis-cluster-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-redis-cluster.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-cluster/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster/README.md b/owl-bot-staging/google-cloud-redis-cluster/README.md new file mode 100644 index 000000000000..5b7fde792872 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/README.md @@ -0,0 +1,141 @@ +# Ruby Client 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-cluster-v*`. +The gem `google-cloud-redis-cluster` 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-cluster/latest) +for this library, google-cloud-redis-cluster, 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-cluster-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-redis-cluster +``` + +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/cluster" + +client = Google::Cloud::Redis::Cluster.cloud_redis_cluster +request = ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new # (request fields as keyword arguments...) +response = client.list_clusters 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-cluster-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-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-cluster`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-redis-cluster-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-cluster`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-redis-cluster-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-cluster/Rakefile b/owl-bot-staging/google-cloud-redis-cluster/Rakefile new file mode 100644 index 000000000000..2738a728b0eb --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/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-cluster acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" + ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-redis-cluster gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-cluster gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-redis-cluster gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-redis-cluster gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis-cluster" + header "google-cloud-redis-cluster rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis-cluster yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis-cluster test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-redis-cluster smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-redis-cluster acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec b/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec new file mode 100644 index 000000000000..e1df54cff930 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/cluster/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis-cluster" + gem.version = Google::Cloud::Redis::Cluster::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 = "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") + + ["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-cluster-v1", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb new file mode 100644 index 000000000000..32acf287e53b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.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/cluster" unless defined? Google::Cloud::Redis::Cluster::VERSION diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb new file mode 100644 index 000000000000..a286b288acb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.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! + +# 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/cluster/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_cluster 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 + module Cluster + ## + # Create a new client object for CloudRedisCluster. + # + # By default, this returns an instance of + # [Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest/Google-Cloud-Redis-Cluster-V1-CloudRedisCluster-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 CloudRedisCluster 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 CloudRedisCluster service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Redis::Cluster.cloud_redis_cluster_available?}. + # + # ## About CloudRedisCluster + # + # Configures and manages Cloud Memorystore for Redis clusters + # + # Google Cloud Memorystore for Redis Cluster + # + # The `redis.googleapis.com` service implements the Google Cloud Memorystore + # for Redis API and defines the following resource model for managing Redis + # clusters: + # * The service works with a collection of cloud projects, named: `/projects/*` + # * Each project has a collection of available locations, named: `/locations/*` + # * Each location has a collection of Redis clusters, named: `/clusters/*` + # * As such, Redis clusters are resources of the form: + # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + # + # Note that location_id must be a GCP `region`; for example: + # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + # + # @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_cluster version: :v1, transport: :grpc, &block + require "google/cloud/redis/cluster/#{version.to_s.downcase}" + + package_name = Google::Cloud::Redis::Cluster + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Redis::Cluster.const_get(package_name).const_get(:CloudRedisCluster) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CloudRedisCluster service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Redis::Cluster.cloud_redis_cluster}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CloudRedisCluster service, + # or if the versioned client gem needs an update to support the CloudRedisCluster 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_cluster_available? version: :v1, transport: :grpc + require "google/cloud/redis/cluster/#{version.to_s.downcase}" + package_name = Google::Cloud::Redis::Cluster + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Redis::Cluster.const_get package_name + return false unless service_module.const_defined? :CloudRedisCluster + service_module = service_module.const_get :CloudRedisCluster + 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-cluster 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_cluster if block_given? + + ::Google::Cloud.configure.redis_cluster + end + end + end + end +end + +helper_path = ::File.join __dir__, "cluster", "helpers.rb" +require "google/cloud/redis/cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb new file mode 100644 index 000000000000..69afe88537e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/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 Cluster + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb new file mode 100644 index 000000000000..ebe5ffde87a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/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/cluster" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Redis::Cluster::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_cluster_grpc + skip unless Google::Cloud::Redis::Cluster.cloud_redis_cluster_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::Cluster.cloud_redis_cluster transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client, client + end + end + + def test_cloud_redis_cluster_rest + skip unless Google::Cloud::Redis::Cluster.cloud_redis_cluster_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Redis::Cluster.cloud_redis_cluster transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb new file mode 100644 index 000000000000..f4255931d11b --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/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/cluster/version" + +class Google::Cloud::Redis::Cluster::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Redis::Cluster::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-cluster/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 4bce18e90756a1f6d25f7e904c2b6667d9fb05b9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:30:34 +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 --- .../.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 | 23 - ...gle-cloud-policy_troubleshooter-v1.gemspec | 29 - .../google-cloud-policy_troubleshooter-v1.rb | 21 - .../google/cloud/policy_troubleshooter/v1.rb | 45 - .../policy_troubleshooter/v1/iam_checker.rb | 56 - .../v1/iam_checker/client.rb | 476 --- .../v1/iam_checker/credentials.rb | 51 - .../v1/iam_checker/rest.rb | 53 - .../v1/iam_checker/rest/client.rb | 434 --- .../v1/iam_checker/rest/service_stub.rb | 141 - .../cloud/policy_troubleshooter/v1/rest.rb | 37 - .../cloud/policy_troubleshooter/v1/version.rb | 28 - .../policytroubleshooter/v1/checker_pb.rb | 50 - .../v1/checker_services_pb.rb | 49 - .../v1/explanations_pb.rb | 55 - .../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/policytroubleshooter/v1/checker.rb | 63 - .../policytroubleshooter/v1/explanations.rb | 268 -- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../iam_checker/troubleshoot_iam_policy.rb | 47 - ..._google.cloud.policytroubleshooter.v1.json | 55 - .../v1/iam_checker_rest_test.rb | 153 - .../v1/iam_checker_test.rb | 162 - .../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 -- ...le-cloud-policy_troubleshooter-iam.gemspec | 27 - .../google-cloud-policy_troubleshooter-iam.rb | 19 - .../google/cloud/policy_troubleshooter/iam.rb | 160 - .../policy_troubleshooter/iam/version.rb | 28 - .../policy_troubleshooter/iam/client_test.rb | 64 - .../policy_troubleshooter/iam/version_test.rb | 26 - .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.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-policy_troubleshooter.gemspec | 27 - .../lib/google-cloud-policy_troubleshooter.rb | 19 - .../lib/google/cloud/policy_troubleshooter.rb | 158 - .../cloud/policy_troubleshooter/version.rb | 26 - .../policy_troubleshooter/client_test.rb | 64 - .../policy_troubleshooter/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 | 168 -- .../gapic_metadata.json | 33 - ...ogle-cloud-private_catalog-v1beta1.gemspec | 28 - .../google-cloud-private_catalog-v1beta1.rb | 21 - .../google/cloud/private_catalog/v1beta1.rb | 45 - .../v1beta1/private_catalog.rb | 74 - .../v1beta1/private_catalog/client.rb | 738 ----- .../v1beta1/private_catalog/credentials.rb | 51 - .../v1beta1/private_catalog/rest.rb | 71 - .../v1beta1/private_catalog/rest/client.rb | 674 ----- .../private_catalog/rest/service_stub.rb | 306 -- .../cloud/private_catalog/v1beta1/rest.rb | 37 - .../cloud/private_catalog/v1beta1/version.rb | 28 - .../v1beta1/private_catalog_pb.rb | 66 - .../v1beta1/private_catalog_services_pb.rb | 72 - .../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 -- .../privatecatalog/v1beta1/private_catalog.rb | 506 ---- .../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/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../private_catalog/search_catalogs.rb | 51 - .../private_catalog/search_products.rb | 51 - .../private_catalog/search_versions.rb | 51 - ...a_google.cloud.privatecatalog.v1beta1.json | 135 - .../v1beta1/private_catalog_rest_test.rb | 270 -- .../v1beta1/private_catalog_test.rb | 311 -- .../test/helper.rb | 25 - .../google-cloud-private_catalog/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-private_catalog/.rubocop.yml | 39 - .../google-cloud-private_catalog/.toys.rb | 28 - .../google-cloud-private_catalog/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-private_catalog/CHANGELOG.md | 2 - .../google-cloud-private_catalog/Gemfile | 28 - .../google-cloud-private_catalog/LICENSE.md | 201 -- .../google-cloud-private_catalog/README.md | 142 - .../google-cloud-private_catalog/Rakefile | 169 -- .../google-cloud-private_catalog.gemspec | 27 - .../lib/google-cloud-private_catalog.rb | 19 - .../lib/google/cloud/private_catalog.rb | 176 -- .../google/cloud/private_catalog/version.rb | 26 - .../cloud/private_catalog/client_test.rb | 64 - .../cloud/private_catalog/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 | 201 -- .../Rakefile | 169 -- .../gapic_metadata.json | 88 - ...cloud-privileged_access_manager-v1.gemspec | 29 - ...ogle-cloud-privileged_access_manager-v1.rb | 21 - .../cloud/privileged_access_manager/v1.rb | 45 - .../v1/bindings_override.rb | 107 - .../v1/privileged_access_manager.rb | 75 - .../v1/privileged_access_manager/client.rb | 1940 ------------ .../privileged_access_manager/credentials.rb | 47 - .../privileged_access_manager/operations.rb | 841 ------ .../v1/privileged_access_manager/paths.rb | 206 -- .../v1/privileged_access_manager/rest.rb | 73 - .../privileged_access_manager/rest/client.rb | 1807 ------------ .../rest/operations.rb | 967 ------ .../rest/service_stub.rb | 1149 -------- .../privileged_access_manager/v1/rest.rb | 38 - .../privileged_access_manager/v1/version.rb | 28 - .../v1/privilegedaccessmanager_pb.rb | 109 - .../v1/privilegedaccessmanager_services_pb.rb | 122 - .../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/privilegedaccessmanager.rb | 1004 ------- .../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 - .../snippets/Gemfile | 32 - .../approve_grant.rb | 47 - .../check_onboarding_status.rb | 47 - .../create_entitlement.rb | 54 - .../privileged_access_manager/create_grant.rb | 47 - .../delete_entitlement.rb | 54 - .../privileged_access_manager/deny_grant.rb | 47 - .../get_entitlement.rb | 47 - .../privileged_access_manager/get_grant.rb | 47 - .../list_entitlements.rb | 51 - .../privileged_access_manager/list_grants.rb | 51 - .../privileged_access_manager/revoke_grant.rb | 54 - .../search_entitlements.rb | 51 - .../search_grants.rb | 51 - .../update_entitlement.rb | 54 - ...ogle.cloud.privilegedaccessmanager.v1.json | 575 ---- ...ivileged_access_manager_operations_test.rb | 400 --- .../privileged_access_manager_paths_test.rb | 115 - .../v1/privileged_access_manager_rest_test.rb | 882 ------ .../v1/privileged_access_manager_test.rb | 1024 ------- .../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 | 189 -- .../Rakefile | 169 -- ...le-cloud-privileged_access_manager.gemspec | 27 - .../google-cloud-privileged_access_manager.rb | 19 - .../google/cloud/privileged_access_manager.rb | 175 -- .../privileged_access_manager/version.rb | 26 - .../privileged_access_manager/client_test.rb | 64 - .../privileged_access_manager/version_test.rb | 26 - .../test/helper.rb | 25 - .../google-cloud-profiler-v2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-profiler-v2/.rubocop.yml | 33 - .../google-cloud-profiler-v2/.toys.rb | 28 - .../google-cloud-profiler-v2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-profiler-v2/CHANGELOG.md | 2 - .../google-cloud-profiler-v2/Gemfile | 11 - .../google-cloud-profiler-v2/LICENSE.md | 201 -- .../google-cloud-profiler-v2/README.md | 154 - .../google-cloud-profiler-v2/Rakefile | 169 -- .../gapic_metadata.json | 47 - .../google-cloud-profiler-v2.gemspec | 28 - .../lib/google-cloud-profiler-v2.rb | 21 - .../lib/google/cloud/profiler/v2.rb | 46 - .../cloud/profiler/v2/export_service.rb | 56 - .../profiler/v2/export_service/client.rb | 496 ---- .../profiler/v2/export_service/credentials.rb | 53 - .../cloud/profiler/v2/export_service/paths.rb | 47 - .../cloud/profiler/v2/export_service/rest.rb | 53 - .../profiler/v2/export_service/rest/client.rb | 446 --- .../v2/export_service/rest/service_stub.rb | 142 - .../cloud/profiler/v2/profiler_service.rb | 59 - .../profiler/v2/profiler_service/client.rb | 716 ----- .../v2/profiler_service/credentials.rb | 53 - .../profiler/v2/profiler_service/paths.rb | 64 - .../profiler/v2/profiler_service/rest.rb | 56 - .../v2/profiler_service/rest/client.rb | 652 ---- .../v2/profiler_service/rest/service_stub.rb | 267 -- .../lib/google/cloud/profiler/v2/rest.rb | 38 - .../lib/google/cloud/profiler/v2/version.rb | 28 - .../devtools/cloudprofiler/v2/profiler_pb.rb | 60 - .../cloudprofiler/v2/profiler_services_pb.rb | 104 - .../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 -- .../devtools/cloudprofiler/v2/profiler.rb | 237 -- .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../google-cloud-profiler-v2/snippets/Gemfile | 32 - .../snippets/export_service/list_profiles.rb | 51 - .../create_offline_profile.rb | 47 - .../profiler_service/create_profile.rb | 47 - .../profiler_service/update_profile.rb | 47 - ...data_google.devtools.cloudprofiler.v2.json | 175 -- .../profiler/v2/export_service_paths_test.rb | 55 - .../profiler/v2/export_service_rest_test.rb | 155 - .../cloud/profiler/v2/export_service_test.rb | 171 -- .../v2/profiler_service_paths_test.rb | 67 - .../profiler/v2/profiler_service_rest_test.rb | 265 -- .../profiler/v2/profiler_service_test.rb | 286 -- .../google-cloud-profiler-v2/test/helper.rb | 25 - .../google-cloud-profiler/.gitignore | 22 - .../google-cloud-profiler/.repo-metadata.json | 18 - .../google-cloud-profiler/.rubocop.yml | 39 - .../google-cloud-profiler/.toys.rb | 28 - .../google-cloud-profiler/.yardopts | 11 - .../google-cloud-profiler/AUTHENTICATION.md | 122 - .../google-cloud-profiler/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-profiler/Gemfile | 28 - .../google-cloud-profiler/LICENSE.md | 201 -- .../google-cloud-profiler/README.md | 142 - .../google-cloud-profiler/Rakefile | 169 -- .../google-cloud-profiler.gemspec | 27 - .../lib/google-cloud-profiler.rb | 19 - .../lib/google/cloud/profiler.rb | 231 -- .../lib/google/cloud/profiler/version.rb | 26 - .../test/google/cloud/profiler/client_test.rb | 85 - .../google/cloud/profiler/version_test.rb | 26 - .../google-cloud-profiler/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 | 68 - ...loud-rapid_migration_assessment-v1.gemspec | 29 - ...gle-cloud-rapid_migration_assessment-v1.rb | 21 - .../cloud/rapid_migration_assessment/v1.rb | 45 - .../v1/bindings_override.rb | 75 - .../v1/rapid_migration_assessment.rb | 56 - .../v1/rapid_migration_assessment/client.rb | 1527 ---------- .../rapid_migration_assessment/credentials.rb | 47 - .../rapid_migration_assessment/operations.rb | 841 ------ .../v1/rapid_migration_assessment/paths.rb | 88 - .../v1/rapid_migration_assessment/rest.rb | 54 - .../rapid_migration_assessment/rest/client.rb | 1422 --------- .../rest/operations.rb | 925 ------ .../rest/service_stub.rb | 697 ----- .../rapid_migration_assessment/v1/rest.rb | 38 - .../rapid_migration_assessment/v1/version.rb | 28 - .../v1/api_entities_pb.rb | 52 - .../v1/rapidmigrationassessment_pb.rb | 65 - .../rapidmigrationassessment_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/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../v1/api_entities.rb | 184 -- .../v1/rapidmigrationassessment.rb | 272 -- .../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 - .../snippets/Gemfile | 32 - .../create_annotation.rb | 54 - .../create_collector.rb | 54 - .../delete_collector.rb | 54 - .../get_annotation.rb | 47 - .../get_collector.rb | 47 - .../list_collectors.rb | 51 - .../pause_collector.rb | 54 - .../register_collector.rb | 54 - .../resume_collector.rb | 54 - .../update_collector.rb | 54 - ...gle.cloud.rapidmigrationassessment.v1.json | 415 --- ...id_migration_assessment_operations_test.rb | 400 --- .../rapid_migration_assessment_paths_test.rb | 79 - .../rapid_migration_assessment_rest_test.rb | 654 ----- .../v1/rapid_migration_assessment_test.rb | 768 ----- .../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 -- ...e-cloud-rapid_migration_assessment.gemspec | 27 - ...google-cloud-rapid_migration_assessment.rb | 19 - .../cloud/rapid_migration_assessment.rb | 156 - .../rapid_migration_assessment/version.rb | 26 - .../rapid_migration_assessment/client_test.rb | 64 - .../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 | 128 - ...ogle-cloud-recaptcha_enterprise-v1.gemspec | 28 - .../google-cloud-recaptcha_enterprise-v1.rb | 21 - .../google/cloud/recaptcha_enterprise/v1.rb | 40 - .../v1/recaptcha_enterprise_service.rb | 49 - .../v1/recaptcha_enterprise_service/client.rb | 2609 ----------------- .../credentials.rb | 51 - .../v1/recaptcha_enterprise_service/paths.rb | 132 - .../cloud/recaptcha_enterprise/v1/version.rb | 28 - .../v1/recaptchaenterprise_pb.rb | 161 - .../v1/recaptchaenterprise_services_pb.rb | 105 - .../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 -- .../v1/recaptchaenterprise.rb | 2230 -------------- .../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 - .../add_ip_override.rb | 47 - .../annotate_assessment.rb | 47 - .../create_assessment.rb | 47 - .../create_firewall_policy.rb | 47 - .../create_key.rb | 47 - .../delete_firewall_policy.rb | 47 - .../delete_key.rb | 47 - .../get_firewall_policy.rb | 47 - .../recaptcha_enterprise_service/get_key.rb | 47 - .../get_metrics.rb | 47 - .../list_firewall_policies.rb | 51 - .../list_ip_overrides.rb | 51 - .../recaptcha_enterprise_service/list_keys.rb | 51 - .../list_related_account_group_memberships.rb | 51 - .../list_related_account_groups.rb | 51 - .../migrate_key.rb | 47 - .../remove_ip_override.rb | 47 - .../reorder_firewall_policies.rb | 47 - .../retrieve_legacy_secret_key.rb | 47 - ...earch_related_account_group_memberships.rb | 51 - .../update_firewall_policy.rb | 47 - .../update_key.rb | 47 - ...a_google.cloud.recaptchaenterprise.v1.json | 895 ------ ...recaptcha_enterprise_service_paths_test.rb | 115 - .../v1/recaptcha_enterprise_service_test.rb | 1468 ---------- .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 19 - .../.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 | 28 - ...cloud-recaptcha_enterprise-v1beta1.gemspec | 28 - ...ogle-cloud-recaptcha_enterprise-v1beta1.rb | 21 - .../cloud/recaptcha_enterprise/v1beta1.rb | 45 - .../v1beta1/recaptcha_enterprise_service.rb | 55 - .../recaptcha_enterprise_service/client.rb | 590 ---- .../credentials.rb | 51 - .../recaptcha_enterprise_service/paths.rb | 64 - .../recaptcha_enterprise_service/rest.rb | 52 - .../rest/client.rb | 533 ---- .../rest/service_stub.rb | 205 -- .../recaptcha_enterprise/v1beta1/rest.rb | 37 - .../recaptcha_enterprise/v1beta1/version.rb | 28 - .../v1beta1/recaptchaenterprise_pb.rb | 73 - .../recaptchaenterprise_services_pb.rb | 48 - .../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 -- .../v1beta1/recaptchaenterprise.rb | 711 ----- .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../annotate_assessment.rb | 47 - .../create_assessment.rb | 47 - ...gle.cloud.recaptchaenterprise.v1beta1.json | 95 - ...recaptcha_enterprise_service_paths_test.rb | 67 - .../recaptcha_enterprise_service_rest_test.rb | 212 -- .../recaptcha_enterprise_service_test.rb | 230 -- .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 39 - .../.toys.rb | 28 - .../.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-recaptcha_enterprise/Gemfile | 28 - .../LICENSE.md | 201 -- .../README.md | 142 - .../Rakefile | 169 -- .../google-cloud-recaptcha_enterprise.gemspec | 27 - .../lib/google-cloud-recaptcha_enterprise.rb | 19 - .../lib/google/cloud/recaptcha_enterprise.rb | 147 - .../cloud/recaptcha_enterprise/version.rb | 26 - .../cloud/recaptcha_enterprise/client_test.rb | 53 - .../recaptcha_enterprise/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 | 120 - ...loud-recommendation_engine-v1beta1.gemspec | 28 - ...gle-cloud-recommendation_engine-v1beta1.rb | 21 - .../cloud/recommendation_engine/v1beta1.rb | 48 - .../v1beta1/catalog_service.rb | 56 - .../v1beta1/catalog_service/client.rb | 1028 ------- .../v1beta1/catalog_service/credentials.rb | 51 - .../v1beta1/catalog_service/operations.rb | 841 ------ .../v1beta1/catalog_service/paths.rb | 73 - .../v1beta1/catalog_service/rest.rb | 53 - .../v1beta1/catalog_service/rest/client.rb | 943 ------ .../catalog_service/rest/operations.rb | 939 ------ .../catalog_service/rest/service_stub.rb | 450 --- .../v1beta1/prediction_api_key_registry.rb | 59 - .../prediction_api_key_registry/client.rb | 693 ----- .../credentials.rb | 51 - .../prediction_api_key_registry/paths.rb | 77 - .../prediction_api_key_registry/rest.rb | 56 - .../rest/client.rb | 629 ---- .../rest/service_stub.rb | 265 -- .../v1beta1/prediction_service.rb | 55 - .../v1beta1/prediction_service/client.rb | 575 ---- .../v1beta1/prediction_service/credentials.rb | 51 - .../v1beta1/prediction_service/paths.rb | 56 - .../v1beta1/prediction_service/rest.rb | 52 - .../v1beta1/prediction_service/rest/client.rb | 525 ---- .../prediction_service/rest/service_stub.rb | 143 - .../recommendation_engine/v1beta1/rest.rb | 40 - .../v1beta1/user_event_service.rb | 56 - .../v1beta1/user_event_service/client.rb | 1009 ------- .../v1beta1/user_event_service/credentials.rb | 51 - .../v1beta1/user_event_service/operations.rb | 841 ------ .../v1beta1/user_event_service/paths.rb | 54 - .../v1beta1/user_event_service/rest.rb | 53 - .../v1beta1/user_event_service/rest/client.rb | 931 ------ .../user_event_service/rest/operations.rb | 939 ------ .../user_event_service/rest/service_stub.rb | 389 --- .../recommendation_engine/v1beta1/version.rb | 28 - .../v1beta1/catalog_pb.rb | 52 - .../v1beta1/catalog_service_pb.rb | 60 - .../v1beta1/catalog_service_services_pb.rb | 61 - .../recommendationengine/v1beta1/common_pb.rb | 44 - .../recommendationengine/v1beta1/import_pb.rb | 64 - .../prediction_apikey_registry_service_pb.rb | 53 - ...ion_apikey_registry_service_services_pb.rb | 53 - .../v1beta1/prediction_service_pb.rb | 53 - .../v1beta1/prediction_service_services_pb.rb | 48 - .../recommendationengine_resources_pb.rb | 43 - .../v1beta1/user_event_pb.rb | 56 - .../v1beta1/user_event_service_pb.rb | 60 - .../v1beta1/user_event_service_services_pb.rb | 66 - .../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 -- .../recommendationengine/v1beta1/catalog.rb | 218 -- .../v1beta1/catalog_service.rb | 110 - .../recommendationengine/v1beta1/common.rb | 89 - .../recommendationengine/v1beta1/import.rb | 212 -- .../prediction_apikey_registry_service.rb | 88 - .../v1beta1/prediction_service.rb | 212 -- .../v1beta1/user_event.rb | 367 --- .../v1beta1/user_event_service.rb | 191 -- .../google/longrunning/operations.rb | 191 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../catalog_service/create_catalog_item.rb | 47 - .../catalog_service/delete_catalog_item.rb | 47 - .../catalog_service/get_catalog_item.rb | 47 - .../catalog_service/import_catalog_items.rb | 54 - .../catalog_service/list_catalog_items.rb | 51 - .../catalog_service/update_catalog_item.rb | 47 - .../create_prediction_api_key_registration.rb | 47 - .../delete_prediction_api_key_registration.rb | 47 - .../list_prediction_api_key_registrations.rb | 51 - .../snippets/prediction_service/predict.rb | 51 - ...le.cloud.recommendationengine.v1beta1.json | 615 ---- .../user_event_service/collect_user_event.rb | 47 - .../user_event_service/import_user_events.rb | 54 - .../user_event_service/list_user_events.rb | 51 - .../user_event_service/purge_user_events.rb | 54 - .../user_event_service/write_user_event.rb | 47 - .../catalog_service_operations_test.rb | 400 --- .../v1beta1/catalog_service_paths_test.rb | 67 - .../v1beta1/catalog_service_rest_test.rb | 432 --- .../v1beta1/catalog_service_test.rb | 494 ---- .../prediction_api_key_registry_paths_test.rb | 67 - .../prediction_api_key_registry_rest_test.rb | 264 -- .../prediction_api_key_registry_test.rb | 289 -- .../v1beta1/prediction_service_paths_test.rb | 55 - .../v1beta1/prediction_service_rest_test.rb | 160 - .../v1beta1/prediction_service_test.rb | 181 -- .../user_event_service_operations_test.rb | 400 --- .../v1beta1/user_event_service_paths_test.rb | 55 - .../v1beta1/user_event_service_rest_test.rb | 381 --- .../v1beta1/user_event_service_test.rb | 447 --- .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.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-recommendation_engine.gemspec | 27 - .../lib/google-cloud-recommendation_engine.rb | 19 - .../lib/google/cloud/recommendation_engine.rb | 370 --- .../cloud/recommendation_engine/version.rb | 26 - .../recommendation_engine/client_test.rb | 127 - .../recommendation_engine/version_test.rb | 26 - .../test/helper.rb | 25 - .../google-cloud-recommender-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-recommender-v1/.rubocop.yml | 33 - .../google-cloud-recommender-v1/.toys.rb | 28 - .../google-cloud-recommender-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-recommender-v1/CHANGELOG.md | 2 - .../google-cloud-recommender-v1/Gemfile | 11 - .../google-cloud-recommender-v1/LICENSE.md | 201 -- .../google-cloud-recommender-v1/README.md | 154 - .../google-cloud-recommender-v1/Rakefile | 169 -- .../gapic_metadata.json | 83 - .../google-cloud-recommender-v1.gemspec | 28 - .../lib/google-cloud-recommender-v1.rb | 21 - .../lib/google/cloud/recommender/v1.rb | 45 - .../google/cloud/recommender/v1/insight_pb.rb | 55 - .../recommender/v1/insight_type_config_pb.rb | 50 - .../cloud/recommender/v1/recommendation_pb.rb | 67 - .../cloud/recommender/v1/recommender.rb | 58 - .../recommender/v1/recommender/client.rb | 1837 ------------ .../recommender/v1/recommender/credentials.rb | 51 - .../cloud/recommender/v1/recommender/paths.rb | 457 --- .../cloud/recommender/v1/recommender/rest.rb | 55 - .../recommender/v1/recommender/rest/client.rb | 1703 ----------- .../v1/recommender/rest/service_stub.rb | 1145 -------- .../recommender/v1/recommender_config_pb.rb | 50 - .../recommender/v1/recommender_service_pb.rb | 71 - .../v1/recommender_service_services_pb.rb | 122 - .../lib/google/cloud/recommender/v1/rest.rb | 37 - .../google/cloud/recommender/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/recommender/v1/insight.rb | 168 -- .../recommender/v1/insight_type_config.rb | 88 - .../cloud/recommender/v1/recommendation.rb | 442 --- .../recommender/v1/recommender_config.rb | 88 - .../recommender/v1/recommender_service.rb | 390 --- .../proto_docs/google/protobuf/duration.rb | 98 - .../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/type/money.rb | 43 - .../snippets/Gemfile | 32 - .../snippets/recommender/get_insight.rb | 47 - .../recommender/get_insight_type_config.rb | 47 - .../recommender/get_recommendation.rb | 47 - .../recommender/get_recommender_config.rb | 47 - .../snippets/recommender/list_insights.rb | 51 - .../recommender/list_recommendations.rb | 51 - .../recommender/mark_insight_accepted.rb | 47 - .../mark_recommendation_claimed.rb | 47 - .../mark_recommendation_dismissed.rb | 47 - .../recommender/mark_recommendation_failed.rb | 47 - .../mark_recommendation_succeeded.rb | 47 - .../recommender/update_insight_type_config.rb | 47 - .../recommender/update_recommender_config.rb | 47 - ..._metadata_google.cloud.recommender.v1.json | 535 ---- .../recommender/v1/recommender_paths_test.rb | 163 - .../recommender/v1/recommender_rest_test.rb | 820 ------ .../cloud/recommender/v1/recommender_test.rb | 906 ------ .../test/helper.rb | 25 - .../google-cloud-recommender/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-recommender/.rubocop.yml | 39 - .../google-cloud-recommender/.toys.rb | 28 - .../google-cloud-recommender/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-recommender/CHANGELOG.md | 2 - .../google-cloud-recommender/Gemfile | 28 - .../google-cloud-recommender/LICENSE.md | 201 -- .../google-cloud-recommender/README.md | 142 - .../google-cloud-recommender/Rakefile | 169 -- .../google-cloud-recommender.gemspec | 27 - .../lib/google-cloud-recommender.rb | 19 - .../lib/google/cloud/recommender.rb | 159 - .../lib/google/cloud/recommender/version.rb | 26 - .../google/cloud/recommender/client_test.rb | 64 - .../google/cloud/recommender/version_test.rb | 26 - .../google-cloud-recommender/test/helper.rb | 25 - .../google-cloud-redis-cluster-v1/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-redis-cluster-v1/.toys.rb | 28 - .../google-cloud-redis-cluster-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-redis-cluster-v1/Gemfile | 11 - .../google-cloud-redis-cluster-v1/LICENSE.md | 201 -- .../google-cloud-redis-cluster-v1/README.md | 153 - .../google-cloud-redis-cluster-v1/Rakefile | 169 -- .../gapic_metadata.json | 88 - .../google-cloud-redis-cluster-v1.gemspec | 29 - .../lib/google-cloud-redis-cluster-v1.rb | 21 - .../lib/google/cloud/redis/cluster/v1.rb | 47 - .../redis/cluster/v1/bindings_override.rb | 77 - .../redis/cluster/v1/cloud_redis_cluster.rb | 72 - .../cluster/v1/cloud_redis_cluster/client.rb | 1958 ------------- .../v1/cloud_redis_cluster/credentials.rb | 49 - .../v1/cloud_redis_cluster/operations.rb | 843 ------ .../cluster/v1/cloud_redis_cluster/paths.rb | 229 -- .../cluster/v1/cloud_redis_cluster/rest.rb | 70 - .../v1/cloud_redis_cluster/rest/client.rb | 1825 ------------ .../v1/cloud_redis_cluster/rest/operations.rb | 926 ------ .../cloud_redis_cluster/rest/service_stub.rb | 942 ------ .../cluster/v1/cloud_redis_cluster_pb.rb | 127 - .../v1/cloud_redis_cluster_services_pb.rb | 122 - .../lib/google/cloud/redis/cluster/v1/rest.rb | 40 - .../google/cloud/redis/cluster/v1/version.rb | 30 - .../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 -- .../redis/cluster/v1/cloud_redis_cluster.rb | 1301 -------- .../google/longrunning/operations.rb | 191 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/dayofweek.rb | 49 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../cloud_redis_cluster/backup_cluster.rb | 54 - .../cloud_redis_cluster/create_cluster.rb | 54 - .../cloud_redis_cluster/delete_backup.rb | 54 - .../cloud_redis_cluster/delete_cluster.rb | 54 - .../cloud_redis_cluster/export_backup.rb | 54 - .../cloud_redis_cluster/get_backup.rb | 47 - .../get_backup_collection.rb | 47 - .../cloud_redis_cluster/get_cluster.rb | 47 - .../get_cluster_certificate_authority.rb | 47 - .../list_backup_collections.rb | 51 - .../cloud_redis_cluster/list_backups.rb | 51 - .../cloud_redis_cluster/list_clusters.rb | 51 - .../reschedule_cluster_maintenance.rb | 54 - .../cloud_redis_cluster/update_cluster.rb | 54 - ...etadata_google.cloud.redis.cluster.v1.json | 575 ---- .../v1/cloud_redis_cluster_operations_test.rb | 400 --- .../v1/cloud_redis_cluster_paths_test.rb | 163 - .../v1/cloud_redis_cluster_rest_test.rb | 873 ------ .../cluster/v1/cloud_redis_cluster_test.rb | 1018 ------- .../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 | 153 - .../Rakefile | 169 -- .../gapic_metadata.json | 88 - ...google-cloud-redis-cluster-v1beta1.gemspec | 29 - .../lib/google-cloud-redis-cluster-v1beta1.rb | 21 - .../lib/google/cloud/redis/cluster/v1beta1.rb | 47 - .../cluster/v1beta1/bindings_override.rb | 77 - .../cluster/v1beta1/cloud_redis_cluster.rb | 72 - .../v1beta1/cloud_redis_cluster/client.rb | 1958 ------------- .../cloud_redis_cluster/credentials.rb | 49 - .../v1beta1/cloud_redis_cluster/operations.rb | 843 ------ .../v1beta1/cloud_redis_cluster/paths.rb | 229 -- .../v1beta1/cloud_redis_cluster/rest.rb | 70 - .../cloud_redis_cluster/rest/client.rb | 1825 ------------ .../cloud_redis_cluster/rest/operations.rb | 926 ------ .../cloud_redis_cluster/rest/service_stub.rb | 942 ------ .../cluster/v1beta1/cloud_redis_cluster_pb.rb | 127 - .../cloud_redis_cluster_services_pb.rb | 122 - .../cloud/redis/cluster/v1beta1/rest.rb | 40 - .../cloud/redis/cluster/v1beta1/version.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 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 -- .../cluster/v1beta1/cloud_redis_cluster.rb | 1301 -------- .../google/longrunning/operations.rb | 191 -- .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 -- .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/dayofweek.rb | 49 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../cloud_redis_cluster/backup_cluster.rb | 54 - .../cloud_redis_cluster/create_cluster.rb | 54 - .../cloud_redis_cluster/delete_backup.rb | 54 - .../cloud_redis_cluster/delete_cluster.rb | 54 - .../cloud_redis_cluster/export_backup.rb | 54 - .../cloud_redis_cluster/get_backup.rb | 47 - .../get_backup_collection.rb | 47 - .../cloud_redis_cluster/get_cluster.rb | 47 - .../get_cluster_certificate_authority.rb | 47 - .../list_backup_collections.rb | 51 - .../cloud_redis_cluster/list_backups.rb | 51 - .../cloud_redis_cluster/list_clusters.rb | 51 - .../reschedule_cluster_maintenance.rb | 54 - .../cloud_redis_cluster/update_cluster.rb | 54 - ...ta_google.cloud.redis.cluster.v1beta1.json | 575 ---- .../cloud_redis_cluster_operations_test.rb | 400 --- .../v1beta1/cloud_redis_cluster_paths_test.rb | 163 - .../v1beta1/cloud_redis_cluster_rest_test.rb | 873 ------ .../v1beta1/cloud_redis_cluster_test.rb | 1018 ------- .../test/helper.rb | 25 - .../google-cloud-redis-cluster/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-redis-cluster/.rubocop.yml | 39 - .../google-cloud-redis-cluster/.toys.rb | 28 - .../google-cloud-redis-cluster/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-redis-cluster/CHANGELOG.md | 2 - .../google-cloud-redis-cluster/Gemfile | 28 - .../google-cloud-redis-cluster/LICENSE.md | 201 -- .../google-cloud-redis-cluster/README.md | 141 - .../google-cloud-redis-cluster/Rakefile | 169 -- .../google-cloud-redis-cluster.gemspec | 27 - .../lib/google-cloud-redis-cluster.rb | 19 - .../lib/google/cloud/redis/cluster.rb | 172 -- .../lib/google/cloud/redis/cluster/version.rb | 28 - .../google/cloud/redis/cluster/client_test.rb | 64 - .../cloud/redis/cluster/version_test.rb | 26 - .../google-cloud-redis-cluster/test/helper.rb | 25 - 865 files changed, 138956 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/.gitignore delete mode 100644 owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-private_catalog/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-private_catalog/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/.yardopts delete mode 100644 owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog/Gemfile delete mode 100644 owl-bot-staging/google-cloud-private_catalog/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog/README.md delete mode 100644 owl-bot-staging/google-cloud-private_catalog/Rakefile delete mode 100644 owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec delete mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-private_catalog/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.gitignore delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/.yardopts delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/Gemfile delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/README.md delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/Rakefile delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-v2.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/.gitignore delete mode 100644 owl-bot-staging/google-cloud-profiler/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-profiler/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-profiler/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/.yardopts delete mode 100644 owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-profiler/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-profiler/Gemfile delete mode 100644 owl-bot-staging/google-cloud-profiler/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-profiler/README.md delete mode 100644 owl-bot-staging/google-cloud-profiler/Rakefile delete mode 100644 owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec delete mode 100644 owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-profiler/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.gitignore delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/README.md delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/Rakefile delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/README.md delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/README.md delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-v1.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommender-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/.gitignore delete mode 100644 owl-bot-staging/google-cloud-recommender/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-recommender/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-recommender/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/.yardopts delete mode 100644 owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-recommender/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-recommender/Gemfile delete mode 100644 owl-bot-staging/google-cloud-recommender/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-recommender/README.md delete mode 100644 owl-bot-staging/google-cloud-recommender/Rakefile delete mode 100644 owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec delete mode 100644 owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-recommender/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-v1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/README.md delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis-cluster/test/helper.rb diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json deleted file mode 100644 index 6afbbc507001..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "policytroubleshooter.googleapis.com", - "api_shortname": "policytroubleshooter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest", - "distribution_name": "google-cloud-policy_troubleshooter-v1", - "is_cloud": true, - "language": "ruby", - "name": "policytroubleshooter", - "name_pretty": "IAM Policy Troubleshooter V1 API", - "product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. Note that google-cloud-policy_troubleshooter-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-policy_troubleshooter instead. See the readme for more details.", - "ruby-cloud-env-prefix": "POLICY_TROUBLESHOOTER", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/troubleshooting-access", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml deleted file mode 100644 index ac23e0ef14cf..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts deleted file mode 100644 index 645955e779fe..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="IAM Policy Troubleshooter 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-policy_troubleshooter-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md deleted file mode 100644 index ff8f9b4e6e7c..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-policy_troubleshooter-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-policy_troubleshooter-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/policy_troubleshooter/v1" - -client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/policy_troubleshooter/v1" - -::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter-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/policy_troubleshooter/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md deleted file mode 100644 index 74c95d4a9292..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the IAM Policy Troubleshooter V1 API - -API Client library for the IAM Policy Troubleshooter V1 API - -Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the IAM Policy Troubleshooter V1 API. Most users should consider using -the main client gem, -[google-cloud-policy_troubleshooter](https://rubygems.org/gems/google-cloud-policy_troubleshooter). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-policy_troubleshooter-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/policytroubleshooter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/policy_troubleshooter/v1" - -client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new -request = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) -response = client.troubleshoot_iam_policy request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam/docs/troubleshooting-access) -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/policy_troubleshooter/v1" -require "logger" - -client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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-policy_troubleshooter`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-policy_troubleshooter-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-policy_troubleshooter`. -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-policy_troubleshooter-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-policy_troubleshooter-v1/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/Rakefile deleted file mode 100644 index 89eab86ad846..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["POLICY_TROUBLESHOOTER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["POLICY_TROUBLESHOOTER_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 POLICY_TROUBLESHOOTER_TEST_PROJECT=test123 POLICY_TROUBLESHOOTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" - ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["POLICY_TROUBLESHOOTER_PROJECT"] = project - ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] = project - ENV["POLICY_TROUBLESHOOTER_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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-policy_troubleshooter-v1" - header "google-cloud-policy_troubleshooter-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-policy_troubleshooter-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-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-policy_troubleshooter-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json deleted file mode 100644 index 43ad259c5c3d..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/gapic_metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.policytroubleshooter.v1", - "libraryPackage": "::Google::Cloud::PolicyTroubleshooter::V1", - "services": { - "IamChecker": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client", - "rpcs": { - "TroubleshootIamPolicy": { - "methods": [ - "troubleshoot_iam_policy" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec deleted file mode 100644 index eb0a9718533d..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/google-cloud-policy_troubleshooter-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/policy_troubleshooter/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-policy_troubleshooter-v1" - gem.version = Google::Cloud::PolicyTroubleshooter::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. Note that google-cloud-policy_troubleshooter-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-policy_troubleshooter instead. See the readme for more details." - gem.summary = "API Client library for the IAM Policy Troubleshooter V1 API" - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.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-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-v1.rb deleted file mode 100644 index aea1e33566bd..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google-cloud-policy_troubleshooter-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/policy_troubleshooter/v1" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1.rb deleted file mode 100644 index ff4c583dc243..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/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/policy_troubleshooter/v1/iam_checker" -require "google/cloud/policy_troubleshooter/v1/version" - -module Google - module Cloud - module PolicyTroubleshooter - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/policy_troubleshooter/v1" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/policy_troubleshooter/v1" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/policy_troubleshooter/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.rb deleted file mode 100644 index db5775e79068..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker.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/policy_troubleshooter/v1/version" - -require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" -require "google/cloud/policy_troubleshooter/v1/iam_checker/client" -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - ## - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/policy_troubleshooter/v1/iam_checker" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - module IamChecker - end - end - end - end -end - -helper_path = ::File.join __dir__, "iam_checker", "helpers.rb" -require "google/cloud/policy_troubleshooter/v1/iam_checker/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb deleted file mode 100644 index a808ce7f8bf6..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/client.rb +++ /dev/null @@ -1,476 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/policytroubleshooter/v1/checker_pb" - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - module IamChecker - ## - # Client for the IamChecker service. - # - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "policytroubleshooter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_checker_stub - - ## - # Configure the IamChecker Client class. - # - # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IamChecker clients - # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "PolicyTroubleshooter", "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: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.troubleshoot_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IamChecker Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @iam_checker_stub.universe_domain - end - - ## - # Create a new IamChecker client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IamChecker 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/policytroubleshooter/v1/checker_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @iam_checker_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @iam_checker_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_checker_stub.logger - end - - # Service calls - - ## - # Checks whether a principal has a specific permission for a specific - # resource, and explains why the principal does or does not have that - # permission. - # - # @overload troubleshoot_iam_policy(request, options = nil) - # Pass arguments to `troubleshoot_iam_policy` via a request object, either of type - # {::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload troubleshoot_iam_policy(access_tuple: nil) - # Pass arguments to `troubleshoot_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 access_tuple [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple, ::Hash] - # The information to use for checking whether a principal has a permission - # for a resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/policy_troubleshooter/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new - # - # # Call the troubleshoot_iam_policy method. - # result = client.troubleshoot_iam_policy request - # - # # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. - # p result - # - def troubleshoot_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.troubleshoot_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::PolicyTroubleshooter::V1::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.troubleshoot_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.troubleshoot_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_checker_stub.call_rpc :troubleshoot_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 - - ## - # Configuration class for the IamChecker API. - # - # This class represents the configuration for IamChecker, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # troubleshoot_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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 = "policytroubleshooter.googleapis.com" - - config_attr :endpoint, nil, ::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 IamChecker API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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 `troubleshoot_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :troubleshoot_iam_policy - - # @private - def initialize parent_rpcs = nil - troubleshoot_iam_policy_config = parent_rpcs.troubleshoot_iam_policy if parent_rpcs.respond_to? :troubleshoot_iam_policy - @troubleshoot_iam_policy = ::Gapic::Config::Method.new troubleshoot_iam_policy_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/credentials.rb deleted file mode 100644 index ea0bcf678236..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/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 PolicyTroubleshooter - module V1 - module IamChecker - # Credentials for the IamChecker API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "POLICY_TROUBLESHOOTER_CREDENTIALS", - "POLICY_TROUBLESHOOTER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "POLICY_TROUBLESHOOTER_CREDENTIALS_JSON", - "POLICY_TROUBLESHOOTER_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-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest.rb deleted file mode 100644 index 4e2e1e3897fa..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/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/policy_troubleshooter/v1/version" - -require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/client" - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - ## - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - module IamChecker - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb deleted file mode 100644 index 6b02bbfc723b..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/client.rb +++ /dev/null @@ -1,434 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/policytroubleshooter/v1/checker_pb" -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub" - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - module IamChecker - module Rest - ## - # REST client for the IamChecker service. - # - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "policytroubleshooter.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_checker_stub - - ## - # Configure the IamChecker Client class. - # - # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IamChecker clients - # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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", "PolicyTroubleshooter", "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: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.troubleshoot_iam_policy.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IamChecker Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @iam_checker_stub.universe_domain - end - - ## - # Create a new IamChecker REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IamChecker client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @iam_checker_stub = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @iam_checker_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_checker_stub.logger - end - - # Service calls - - ## - # Checks whether a principal has a specific permission for a specific - # resource, and explains why the principal does or does not have that - # permission. - # - # @overload troubleshoot_iam_policy(request, options = nil) - # Pass arguments to `troubleshoot_iam_policy` via a request object, either of type - # {::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload troubleshoot_iam_policy(access_tuple: nil) - # Pass arguments to `troubleshoot_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 access_tuple [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple, ::Hash] - # The information to use for checking whether a principal has a permission - # for a resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/policy_troubleshooter/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new - # - # # Call the troubleshoot_iam_policy method. - # result = client.troubleshoot_iam_policy request - # - # # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. - # p result - # - def troubleshoot_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.troubleshoot_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::PolicyTroubleshooter::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.troubleshoot_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.troubleshoot_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_checker_stub.troubleshoot_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 - - ## - # Configuration class for the IamChecker REST API. - # - # This class represents the configuration for IamChecker 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::PolicyTroubleshooter::V1::IamChecker::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 - # # troubleshoot_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.troubleshoot_iam_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "policytroubleshooter.googleapis.com" - - config_attr :endpoint, nil, ::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 IamChecker API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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 `troubleshoot_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :troubleshoot_iam_policy - - # @private - def initialize parent_rpcs = nil - troubleshoot_iam_policy_config = parent_rpcs.troubleshoot_iam_policy if parent_rpcs.respond_to? :troubleshoot_iam_policy - @troubleshoot_iam_policy = ::Gapic::Config::Method.new troubleshoot_iam_policy_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb deleted file mode 100644 index e58eaa274bd3..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb +++ /dev/null @@ -1,141 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/policytroubleshooter/v1/checker_pb" - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - module IamChecker - module Rest - ## - # REST service stub for the IamChecker 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 troubleshoot_iam_policy REST call - # - # @param request_pb [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse] - # A result object deserialized from the server's reply - def troubleshoot_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_troubleshoot_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: "troubleshoot_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.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 troubleshoot_iam_policy REST call - # - # @param request_pb [::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_troubleshoot_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/iam:troubleshoot", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb deleted file mode 100644 index fdf326eb15b0..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" -require "google/cloud/policy_troubleshooter/v1/version" - -module Google - module Cloud - module PolicyTroubleshooter - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/policy_troubleshooter/v1/rest" - # client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/version.rb deleted file mode 100644 index f222f8c6a79d..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/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 PolicyTroubleshooter - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb deleted file mode 100644 index 1933957f8f97..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/policytroubleshooter/v1/checker.proto - -require 'google/protobuf' - -require 'google/cloud/policytroubleshooter/v1/explanations_pb' -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n2google/cloud/policytroubleshooter/v1/checker.proto\x12$google.cloud.policytroubleshooter.v1\x1a\x37google/cloud/policytroubleshooter/v1/explanations.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x17google/rpc/status.proto\"g\n\x1cTroubleshootIamPolicyRequest\x12G\n\x0c\x61\x63\x63\x65ss_tuple\x18\x01 \x01(\x0b\x32\x31.google.cloud.policytroubleshooter.v1.AccessTuple\"\xd9\x01\n\x1dTroubleshootIamPolicyResponse\x12\x41\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessState\x12Q\n\x12\x65xplained_policies\x18\x02 \x03(\x0b\x32\x35.google.cloud.policytroubleshooter.v1.ExplainedPolicy\x12\"\n\x06\x65rrors\x18\x03 \x03(\x0b\x32\x12.google.rpc.Status2\xa9\x02\n\nIamChecker\x12\xc1\x01\n\x15TroubleshootIamPolicy\x12\x42.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest\x1a\x43.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/iam:troubleshoot:\x01*\x1aW\xca\x41#policytroubleshooter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x96\x02\n(com.google.cloud.policytroubleshooter.v1B\x0fIAMCheckerProtoP\x01Z\\cloud.google.com/go/policytroubleshooter/apiv1/policytroubleshooterpb;policytroubleshooterpb\xf8\x01\x01\xaa\x02$Google.Cloud.PolicyTroubleshooter.V1\xca\x02$Google\\Cloud\\PolicyTroubleshooter\\V1\xea\x02\'Google::Cloud::PolicyTroubleshooter::V1P\x00\x62\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.policytroubleshooter.v1.AccessTuple", "google/cloud/policytroubleshooter/v1/explanations.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 PolicyTroubleshooter - module V1 - TroubleshootIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest").msgclass - TroubleshootIamPolicyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb deleted file mode 100644 index ea050d9096d7..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/policytroubleshooter/v1/checker.proto for package 'Google.Cloud.PolicyTroubleshooter.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/policytroubleshooter/v1/checker_pb' - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - module IamChecker - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.policytroubleshooter.v1.IamChecker' - - # Checks whether a principal has a specific permission for a specific - # resource, and explains why the principal does or does not have that - # permission. - rpc :TroubleshootIamPolicy, ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb deleted file mode 100644 index ec390cf5fcbf..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/policytroubleshooter/v1/explanations.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/iam/v1/policy_pb' -require 'google/type/expr_pb' - - -descriptor_data = "\n7google/cloud/policytroubleshooter/v1/explanations.proto\x12$google.cloud.policytroubleshooter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x16google/type/expr.proto\"_\n\x0b\x41\x63\x63\x65ssTuple\x12\x16\n\tprincipal\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x66ull_resource_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\npermission\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xbc\x02\n\x0f\x45xplainedPolicy\x12\x41\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessState\x12\x1a\n\x12\x66ull_resource_name\x18\x02 \x01(\t\x12%\n\x06policy\x18\x03 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12V\n\x14\x62inding_explanations\x18\x04 \x03(\x0b\x32\x38.google.cloud.policytroubleshooter.v1.BindingExplanation\x12K\n\trelevance\x18\x05 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\"\x83\t\n\x12\x42indingExplanation\x12\x46\n\x06\x61\x63\x63\x65ss\x18\x01 \x01(\x0e\x32\x31.google.cloud.policytroubleshooter.v1.AccessStateB\x03\xe0\x41\x02\x12\x0c\n\x04role\x18\x02 \x01(\t\x12`\n\x0frole_permission\x18\x03 \x01(\x0e\x32G.google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission\x12[\n\x19role_permission_relevance\x18\x04 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x12^\n\x0bmemberships\x18\x05 \x03(\x0b\x32I.google.cloud.policytroubleshooter.v1.BindingExplanation.MembershipsEntry\x12K\n\trelevance\x18\x06 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x12$\n\tcondition\x18\x07 \x01(\x0b\x32\x11.google.type.Expr\x1a\xbb\x01\n\x13\x41nnotatedMembership\x12W\n\nmembership\x18\x01 \x01(\x0e\x32\x43.google.cloud.policytroubleshooter.v1.BindingExplanation.Membership\x12K\n\trelevance\x18\x02 \x01(\x0e\x32\x38.google.cloud.policytroubleshooter.v1.HeuristicRelevance\x1a\x80\x01\n\x10MembershipsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12[\n\x05value\x18\x02 \x01(\x0b\x32L.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership:\x02\x38\x01\"\x9a\x01\n\x0eRolePermission\x12\x1f\n\x1bROLE_PERMISSION_UNSPECIFIED\x10\x00\x12\x1c\n\x18ROLE_PERMISSION_INCLUDED\x10\x01\x12 \n\x1cROLE_PERMISSION_NOT_INCLUDED\x10\x02\x12\'\n#ROLE_PERMISSION_UNKNOWN_INFO_DENIED\x10\x03\"\xa6\x01\n\nMembership\x12\x1a\n\x16MEMBERSHIP_UNSPECIFIED\x10\x00\x12\x17\n\x13MEMBERSHIP_INCLUDED\x10\x01\x12\x1b\n\x17MEMBERSHIP_NOT_INCLUDED\x10\x02\x12\"\n\x1eMEMBERSHIP_UNKNOWN_INFO_DENIED\x10\x03\x12\"\n\x1eMEMBERSHIP_UNKNOWN_UNSUPPORTED\x10\x04*{\n\x0b\x41\x63\x63\x65ssState\x12\x1c\n\x18\x41\x43\x43\x45SS_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07GRANTED\x10\x01\x12\x0f\n\x0bNOT_GRANTED\x10\x02\x12\x17\n\x13UNKNOWN_CONDITIONAL\x10\x03\x12\x17\n\x13UNKNOWN_INFO_DENIED\x10\x04*O\n\x12HeuristicRelevance\x12#\n\x1fHEURISTIC_RELEVANCE_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x42\xd6\x01Z\\cloud.google.com/go/policytroubleshooter/apiv1/policytroubleshooterpb;policytroubleshooterpb\xaa\x02$Google.Cloud.PolicyTroubleshooter.V1\xca\x02$Google\\Cloud\\PolicyTroubleshooter\\V1\xea\x02\'Google::Cloud::PolicyTroubleshooter::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.iam.v1.Policy", "google/iam/v1/policy.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 PolicyTroubleshooter - module V1 - AccessTuple = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.AccessTuple").msgclass - ExplainedPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.ExplainedPolicy").msgclass - BindingExplanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation").msgclass - BindingExplanation::AnnotatedMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership").msgclass - BindingExplanation::RolePermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission").enummodule - BindingExplanation::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.BindingExplanation.Membership").enummodule - AccessState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.AccessState").enummodule - HeuristicRelevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.policytroubleshooter.v1.HeuristicRelevance").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md deleted file mode 100644 index 7f77420fe049..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# IAM Policy Troubleshooter 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-policy_troubleshooter-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb deleted file mode 100644 index af8cbc579260..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/checker.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - # Request for - # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy TroubleshootIamPolicy}. - # @!attribute [rw] access_tuple - # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple] - # The information to use for checking whether a principal has a permission - # for a resource. - class TroubleshootIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for - # {::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy TroubleshootIamPolicy}. - # @!attribute [rw] access - # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] - # Indicates whether the principal has the specified permission for the - # specified resource, based on evaluating all of the applicable IAM policies. - # @!attribute [rw] explained_policies - # @return [::Array<::Google::Cloud::PolicyTroubleshooter::V1::ExplainedPolicy>] - # List of IAM policies that were evaluated to check the principal's - # permissions, with annotations to indicate how each policy contributed to - # the final result. - # - # The list of policies can include the policy for the resource itself. It can - # also include policies that are inherited from higher levels of the resource - # hierarchy, including the organization, the folder, and the project. - # - # To learn more about the resource hierarchy, see - # https://cloud.google.com/iam/help/resource-hierarchy. - # @!attribute [rw] errors - # @return [::Array<::Google::Rpc::Status>] - # The general errors contained in the troubleshooting response. - class TroubleshootIamPolicyResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb deleted file mode 100644 index f85ed31e20b8..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb +++ /dev/null @@ -1,268 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PolicyTroubleshooter - module V1 - # Information about the principal, resource, and permission to check. - # @!attribute [rw] principal - # @return [::String] - # Required. The principal whose access you want to check, in the form of - # the email address that represents that principal. For example, - # `alice@example.com` or - # `my-service-account@my-project.iam.gserviceaccount.com`. - # - # The principal must be a Google Account or a service account. Other types of - # principals are not supported. - # @!attribute [rw] full_resource_name - # @return [::String] - # Required. The full resource name that identifies the resource. For example, - # `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - # - # For examples of full resource names for Google Cloud services, see - # https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - # @!attribute [rw] permission - # @return [::String] - # Required. The IAM permission to check for the specified principal and - # resource. - # - # For a complete list of IAM permissions, see - # https://cloud.google.com/iam/help/permissions/reference. - # - # For a complete list of predefined IAM roles and the permissions in each - # role, see https://cloud.google.com/iam/help/roles/reference. - class AccessTuple - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how a specific IAM [Policy][google.iam.v1.Policy] contributed - # to the access check. - # @!attribute [rw] access - # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] - # Indicates whether _this policy_ provides the specified permission to the - # specified principal for the specified resource. - # - # This field does _not_ indicate whether the principal actually has the - # permission for the resource. There might be another policy that overrides - # this policy. To determine whether the principal actually has the - # permission, use the `access` field in the - # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - # @!attribute [rw] full_resource_name - # @return [::String] - # The full resource name that identifies the resource. For example, - # `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. - # - # If the sender of the request does not have access to the policy, this field - # is omitted. - # - # For examples of full resource names for Google Cloud services, see - # https://cloud.google.com/iam/help/troubleshooter/full-resource-names. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # The IAM policy attached to the resource. - # - # If the sender of the request does not have access to the policy, this field - # is empty. - # @!attribute [rw] binding_explanations - # @return [::Array<::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation>] - # Details about how each binding in the policy affects the principal's - # ability, or inability, to use the permission for the resource. - # - # If the sender of the request does not have access to the policy, this field - # is omitted. - # @!attribute [rw] relevance - # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] - # The relevance of this policy to the overall determination in the - # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - # - # If the sender of the request does not have access to the policy, this field - # is omitted. - class ExplainedPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how a binding in a policy affects a principal's ability to use - # a permission. - # @!attribute [rw] access - # @return [::Google::Cloud::PolicyTroubleshooter::V1::AccessState] - # Required. Indicates whether _this binding_ provides the specified - # permission to the specified principal for the specified resource. - # - # This field does _not_ indicate whether the principal actually has the - # permission for the resource. There might be another binding that overrides - # this binding. To determine whether the principal actually has the - # permission, use the `access` field in the - # [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. - # @!attribute [rw] role - # @return [::String] - # The role that this binding grants. For example, - # `roles/compute.serviceAgent`. - # - # For a complete list of predefined IAM roles, as well as the permissions in - # each role, see https://cloud.google.com/iam/help/roles/reference. - # @!attribute [rw] role_permission - # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::RolePermission] - # Indicates whether the role granted by this binding contains the specified - # permission. - # @!attribute [rw] role_permission_relevance - # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] - # The relevance of the permission's existence, or nonexistence, in the role - # to the overall determination for the entire policy. - # @!attribute [rw] memberships - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::AnnotatedMembership}] - # Indicates whether each principal in the binding includes the principal - # specified in the request, either directly or indirectly. Each key - # identifies a principal in the binding, and each value indicates whether the - # principal in the binding includes the principal in the request. - # - # For example, suppose that a binding includes the following principals: - # - # * `user:alice@example.com` - # * `group:product-eng@example.com` - # - # You want to troubleshoot access for `user:bob@example.com`. This user is a - # principal of the group `group:product-eng@example.com`. - # - # For the first principal in the binding, the key is - # `user:alice@example.com`, and the `membership` field in the value is set to - # `MEMBERSHIP_NOT_INCLUDED`. - # - # For the second principal in the binding, the key is - # `group:product-eng@example.com`, and the `membership` field in the value is - # set to `MEMBERSHIP_INCLUDED`. - # @!attribute [rw] relevance - # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] - # The relevance of this binding to the overall determination for the entire - # policy. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # A condition expression that prevents this binding from granting access - # unless the expression evaluates to `true`. - # - # To learn about IAM Conditions, see - # https://cloud.google.com/iam/help/conditions/overview. - class BindingExplanation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details about whether the binding includes the principal. - # @!attribute [rw] membership - # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::Membership] - # Indicates whether the binding includes the principal. - # @!attribute [rw] relevance - # @return [::Google::Cloud::PolicyTroubleshooter::V1::HeuristicRelevance] - # The relevance of the principal's status to the overall determination for - # the binding. - class AnnotatedMembership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::PolicyTroubleshooter::V1::BindingExplanation::AnnotatedMembership] - class MembershipsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Whether a role includes a specific permission. - module RolePermission - # Default value. This value is unused. - ROLE_PERMISSION_UNSPECIFIED = 0 - - # The permission is included in the role. - ROLE_PERMISSION_INCLUDED = 1 - - # The permission is not included in the role. - ROLE_PERMISSION_NOT_INCLUDED = 2 - - # The sender of the request is not allowed to access the binding. - ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3 - end - - # Whether the binding includes the principal. - module Membership - # Default value. This value is unused. - MEMBERSHIP_UNSPECIFIED = 0 - - # The binding includes the principal. The principal can be included - # directly or indirectly. For example: - # - # * A principal is included directly if that principal is listed in the - # binding. - # * A principal is included indirectly if that principal is in a Google - # group or Google Workspace domain that is listed in the binding. - MEMBERSHIP_INCLUDED = 1 - - # The binding does not include the principal. - MEMBERSHIP_NOT_INCLUDED = 2 - - # The sender of the request is not allowed to access the binding. - MEMBERSHIP_UNKNOWN_INFO_DENIED = 3 - - # The principal is an unsupported type. Only Google Accounts and service - # accounts are supported. - MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4 - end - end - - # Whether a principal has a permission for a resource. - module AccessState - # Default value. This value is unused. - ACCESS_STATE_UNSPECIFIED = 0 - - # The principal has the permission. - GRANTED = 1 - - # The principal does not have the permission. - NOT_GRANTED = 2 - - # The principal has the permission only if a condition expression evaluates - # to `true`. - UNKNOWN_CONDITIONAL = 3 - - # The sender of the request does not have access to all of the policies that - # Policy Troubleshooter needs to evaluate. - UNKNOWN_INFO_DENIED = 4 - end - - # The extent to which a single data point, such as the existence of a binding - # or whether a binding includes a specific principal, contributes to an overall - # determination. - module HeuristicRelevance - # Default value. This value is unused. - HEURISTIC_RELEVANCE_UNSPECIFIED = 0 - - # The data point has a limited effect on the result. Changing the data point - # is unlikely to affect the overall determination. - NORMAL = 1 - - # The data point has a strong effect on the result. Changing the data point - # is likely to affect the overall determination. - HIGH = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/Gemfile deleted file mode 100644 index 663c510dbf5e..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1", path: "../" -else - gem "google-cloud-policy_troubleshooter-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-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb deleted file mode 100644 index ec04da284cc5..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_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 policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] -require "google/cloud/policy_troubleshooter/v1" - -## -# Snippet for the troubleshoot_iam_policy call in the IamChecker service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy. -# -def troubleshoot_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new - - # Call the troubleshoot_iam_policy method. - result = client.troubleshoot_iam_policy request - - # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. - p result -end -# [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json deleted file mode 100644 index dde6c1e2f061..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-policy_troubleshooter-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.policytroubleshooter.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync", - "title": "Snippet for the troubleshoot_iam_policy call in the IamChecker service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy.", - "file": "iam_checker/troubleshoot_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "troubleshoot_iam_policy", - "full_name": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse", - "client": { - "short_name": "IamChecker::Client", - "full_name": "::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client" - }, - "method": { - "short_name": "TroubleshootIamPolicy", - "full_name": "google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy", - "service": { - "short_name": "IamChecker", - "full_name": "google.cloud.policytroubleshooter.v1.IamChecker" - } - } - }, - "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-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb deleted file mode 100644 index 6eeebe353276..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/policytroubleshooter/v1/checker_pb" -require "google/cloud/policy_troubleshooter/v1/iam_checker/rest" - - -class ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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_troubleshoot_iam_policy - # Create test objects. - client_result = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - access_tuple = {} - - troubleshoot_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::PolicyTroubleshooter::V1::IamChecker::Rest::ServiceStub.stub :transcode_troubleshoot_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, troubleshoot_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.troubleshoot_iam_policy({ access_tuple: access_tuple }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.troubleshoot_iam_policy access_tuple: access_tuple do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.troubleshoot_iam_policy ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.troubleshoot_iam_policy({ access_tuple: access_tuple }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.troubleshoot_iam_policy(::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, troubleshoot_iam_policy_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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb deleted file mode 100644 index 894ec8205435..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb +++ /dev/null @@ -1,162 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/policytroubleshooter/v1/checker_pb" -require "google/cloud/policy_troubleshooter/v1/iam_checker" - -class ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::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_troubleshoot_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - access_tuple = {} - - troubleshoot_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :troubleshoot_iam_policy, name - assert_kind_of ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PolicyTroubleshooter::V1::AccessTuple), request["access_tuple"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, troubleshoot_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.troubleshoot_iam_policy({ access_tuple: access_tuple }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.troubleshoot_iam_policy access_tuple: access_tuple do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.troubleshoot_iam_policy ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.troubleshoot_iam_policy({ access_tuple: access_tuple }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.troubleshoot_iam_policy(::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new(access_tuple: access_tuple), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, troubleshoot_iam_policy_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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::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::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter-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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json deleted file mode 100644 index c47f4da4c33a..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "policytroubleshooter.googleapis.com", - "api_shortname": "policytroubleshooter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam/latest", - "distribution_name": "google-cloud-policy_troubleshooter-iam", - "is_cloud": true, - "language": "ruby", - "name": "policytroubleshooter", - "name_pretty": "Policy Troubleshooter API", - "product_documentation": "https://cloud.google.com/policy-intelligence/docs/troubleshoot-access", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API.", - "ruby-cloud-product-url": "https://cloud.google.com/policy-intelligence/docs/troubleshoot-access", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml deleted file mode 100644 index e4518405b0ab..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-policy_troubleshooter-iam.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-policy_troubleshooter-iam.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts deleted file mode 100644 index f28b50b2ea64..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Policy Troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md deleted file mode 100644 index 28ac37859c3f..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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/policy_troubleshooter/iam" - -client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/policy_troubleshooter/iam" - -Google::Cloud::PolicyTroubleshooter::Iam.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter -``` - -### 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-policy_troubleshooter-iam -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/policy_troubleshooter/iam" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter -``` - -### 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile deleted file mode 100644 index a6d541a39eee..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-policy_troubleshooter-iam-v3"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-policy_troubleshooter-iam.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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md deleted file mode 100644 index aa8f773a89c1..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Policy Troubleshooter API - -API Client library for the Policy Troubleshooter API - -google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-policy_troubleshooter-iam-v*`. -The gem `google-cloud-policy_troubleshooter-iam` 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-policy_troubleshooter-iam/latest) -for this library, google-cloud-policy_troubleshooter-iam, 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-policy_troubleshooter-iam-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest). - -See also the [Product Documentation](https://cloud.google.com/policy-intelligence/docs/troubleshoot-access) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-policy_troubleshooter-iam -``` - -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/policytroubleshooter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/policy_troubleshooter/iam" - -client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter -request = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) -response = client.troubleshoot_iam_policy 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-policy_troubleshooter-iam-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter-iam`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter-iam`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-policy_troubleshooter-iam-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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/Rakefile deleted file mode 100644 index 015ce07af372..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter-iam 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/policy_troubleshooter/iam/v3/policy_troubleshooter/credentials" - ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-policy_troubleshooter-iam" - header "google-cloud-policy_troubleshooter-iam rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-policy_troubleshooter-iam yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter-iam 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-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec deleted file mode 100644 index b40aaad45bb8..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/google-cloud-policy_troubleshooter-iam.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/policy_troubleshooter/iam/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-policy_troubleshooter-iam" - gem.version = Google::Cloud::PolicyTroubleshooter::Iam::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "google-cloud-policy_troubleshooter-iam is the official client library for the Policy Troubleshooter API." - gem.summary = "API Client library for the Policy Troubleshooter 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-policy_troubleshooter-iam-v3", ">= 0.3", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.rb deleted file mode 100644 index fc0fb2397c75..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google-cloud-policy_troubleshooter-iam.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/policy_troubleshooter/iam" unless defined? Google::Cloud::PolicyTroubleshooter::Iam::VERSION diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.rb deleted file mode 100644 index 44d3d533f173..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam.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 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/policy_troubleshooter/iam/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! :policy_troubleshooter_iam 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 PolicyTroubleshooter - module Iam - ## - # Create a new client object for PolicyTroubleshooter. - # - # By default, this returns an instance of - # [Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Cloud-PolicyTroubleshooter-Iam-V3-PolicyTroubleshooter-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 PolicyTroubleshooter 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 PolicyTroubleshooter service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_available?}. - # - # ## About PolicyTroubleshooter - # - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud 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.policy_troubleshooter version: :v3, transport: :grpc, &block - require "google/cloud/policy_troubleshooter/iam/#{version.to_s.downcase}" - - package_name = Google::Cloud::PolicyTroubleshooter::Iam - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::PolicyTroubleshooter::Iam.const_get(package_name).const_get(:PolicyTroubleshooter) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PolicyTroubleshooter service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PolicyTroubleshooter service, - # or if the versioned client gem needs an update to support the PolicyTroubleshooter 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.policy_troubleshooter_available? version: :v3, transport: :grpc - require "google/cloud/policy_troubleshooter/iam/#{version.to_s.downcase}" - package_name = Google::Cloud::PolicyTroubleshooter::Iam - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::PolicyTroubleshooter::Iam.const_get package_name - return false unless service_module.const_defined? :PolicyTroubleshooter - service_module = service_module.const_get :PolicyTroubleshooter - 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-policy_troubleshooter-iam 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.policy_troubleshooter_iam if block_given? - - ::Google::Cloud.configure.policy_troubleshooter_iam - end - end - end - end -end - -helper_path = ::File.join __dir__, "iam", "helpers.rb" -require "google/cloud/policy_troubleshooter/iam/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/version.rb deleted file mode 100644 index 79cc2faf17d4..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/lib/google/cloud/policy_troubleshooter/iam/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 PolicyTroubleshooter - module Iam - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/client_test.rb deleted file mode 100644 index 78a1d06c1db9..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/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/policy_troubleshooter/iam" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::PolicyTroubleshooter::Iam::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_policy_troubleshooter_grpc - skip unless Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_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::PolicyTroubleshooter::Iam.policy_troubleshooter transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client, client - end - end - - def test_policy_troubleshooter_rest - skip unless Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::PolicyTroubleshooter::Iam.policy_troubleshooter transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/version_test.rb deleted file mode 100644 index cb5c62d423b8..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/google/cloud/policy_troubleshooter/iam/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/policy_troubleshooter/iam/version" - -class Google::Cloud::PolicyTroubleshooter::Iam::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::PolicyTroubleshooter::Iam::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter-iam/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-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.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-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json deleted file mode 100644 index 9ac44371e219..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "policytroubleshooter.googleapis.com", - "api_shortname": "policytroubleshooter", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter/latest", - "distribution_name": "google-cloud-policy_troubleshooter", - "is_cloud": true, - "language": "ruby", - "name": "policytroubleshooter", - "name_pretty": "IAM Policy Troubleshooter API", - "product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles.", - "ruby-cloud-env-prefix": "POLICY_TROUBLESHOOTER", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/troubleshooting-access", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml deleted file mode 100644 index 9b012e2b5610..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-policy_troubleshooter.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-policy_troubleshooter.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.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-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts deleted file mode 100644 index 7f48b4ccc854..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="IAM Policy Troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md deleted file mode 100644 index 74d90fd5d123..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-policy_troubleshooter 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-policy_troubleshooter 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/policy_troubleshooter" - -client = Google::Cloud::PolicyTroubleshooter.iam_checker do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/policy_troubleshooter" - -Google::Cloud::PolicyTroubleshooter.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::PolicyTroubleshooter.iam_checker -``` - -### 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-policy_troubleshooter -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/policy_troubleshooter" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::PolicyTroubleshooter.iam_checker -``` - -### 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-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile deleted file mode 100644 index 6bea76c13c23..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-policy_troubleshooter-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-policy_troubleshooter.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-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md deleted file mode 100644 index 984a8b7ad507..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the IAM Policy Troubleshooter API - -API Client library for the IAM Policy Troubleshooter API - -Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-policy_troubleshooter-v*`. -The gem `google-cloud-policy_troubleshooter` 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-policy_troubleshooter/latest) -for this library, google-cloud-policy_troubleshooter, 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-policy_troubleshooter-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/iam/docs/troubleshooting-access) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-policy_troubleshooter -``` - -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/policytroubleshooter.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/policy_troubleshooter" - -client = Google::Cloud::PolicyTroubleshooter.iam_checker -request = ::Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new # (request fields as keyword arguments...) -response = client.troubleshoot_iam_policy 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-policy_troubleshooter-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-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-policy_troubleshooter`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-policy_troubleshooter-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-policy_troubleshooter`. -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-policy_troubleshooter-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-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/Rakefile deleted file mode 100644 index 640387ccb27d..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-policy_troubleshooter acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["POLICY_TROUBLESHOOTER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["POLICY_TROUBLESHOOTER_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 POLICY_TROUBLESHOOTER_TEST_PROJECT=test123 POLICY_TROUBLESHOOTER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/policy_troubleshooter/v1/iam_checker/credentials" - ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["POLICY_TROUBLESHOOTER_PROJECT"] = project - ENV["POLICY_TROUBLESHOOTER_TEST_PROJECT"] = project - ENV["POLICY_TROUBLESHOOTER_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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-policy_troubleshooter" - header "google-cloud-policy_troubleshooter rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-policy_troubleshooter yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter 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-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec deleted file mode 100644 index f634d596469e..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/policy_troubleshooter/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-policy_troubleshooter" - gem.version = Google::Cloud::PolicyTroubleshooter::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Policy Troubleshooter makes it easier to understand why a user has access to a resource or doesn't have permission to call an API. Given an email, resource, and permission, Policy Troubleshooter will examine all IAM policies that apply to the resource. It then reveals whether the member's roles include the permission on that resource and, if so, which policies bind the member to those roles." - gem.summary = "API Client library for the IAM Policy Troubleshooter 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-policy_troubleshooter-v1", ">= 0.10", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.rb deleted file mode 100644 index 19fbbe0a4894..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google-cloud-policy_troubleshooter.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/policy_troubleshooter" unless defined? Google::Cloud::PolicyTroubleshooter::VERSION diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.rb deleted file mode 100644 index e523e06cb76c..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter.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/policy_troubleshooter/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! :policy_troubleshooter 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 PolicyTroubleshooter - ## - # Create a new client object for IamChecker. - # - # By default, this returns an instance of - # [Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest/Google-Cloud-PolicyTroubleshooter-V1-IamChecker-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 IamChecker 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 IamChecker service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::PolicyTroubleshooter.iam_checker_available?}. - # - # ## About IamChecker - # - # IAM Policy Troubleshooter service. - # - # This service helps you troubleshoot access issues for Google Cloud resources. - # - # @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.iam_checker version: :v1, transport: :grpc, &block - require "google/cloud/policy_troubleshooter/#{version.to_s.downcase}" - - package_name = Google::Cloud::PolicyTroubleshooter - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::PolicyTroubleshooter.const_get(package_name).const_get(:IamChecker) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the IamChecker service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::PolicyTroubleshooter.iam_checker}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the IamChecker service, - # or if the versioned client gem needs an update to support the IamChecker 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.iam_checker_available? version: :v1, transport: :grpc - require "google/cloud/policy_troubleshooter/#{version.to_s.downcase}" - package_name = Google::Cloud::PolicyTroubleshooter - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::PolicyTroubleshooter.const_get package_name - return false unless service_module.const_defined? :IamChecker - service_module = service_module.const_get :IamChecker - 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-policy_troubleshooter 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.policy_troubleshooter if block_given? - - ::Google::Cloud.configure.policy_troubleshooter - end - end - end -end - -helper_path = ::File.join __dir__, "policy_troubleshooter", "helpers.rb" -require "google/cloud/policy_troubleshooter/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/version.rb deleted file mode 100644 index 595795835e5a..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/lib/google/cloud/policy_troubleshooter/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 PolicyTroubleshooter - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/client_test.rb deleted file mode 100644 index de8c17a5ec96..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/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/policy_troubleshooter" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::PolicyTroubleshooter::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_iam_checker_grpc - skip unless Google::Cloud::PolicyTroubleshooter.iam_checker_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::PolicyTroubleshooter.iam_checker transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client, client - end - end - - def test_iam_checker_rest - skip unless Google::Cloud::PolicyTroubleshooter.iam_checker_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::PolicyTroubleshooter.iam_checker transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/version_test.rb deleted file mode 100644 index ab6405e39f79..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/google/cloud/policy_troubleshooter/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/policy_troubleshooter/version" - -class Google::Cloud::PolicyTroubleshooter::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::PolicyTroubleshooter::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb b/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-policy_troubleshooter/google-cloud-policy_troubleshooter/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-private_catalog-v1beta1/.gitignore b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json deleted file mode 100644 index cd71d7c86d70..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudprivatecatalog.googleapis.com", - "api_shortname": "cloudprivatecatalog", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest", - "distribution_name": "google-cloud-private_catalog-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "cloudprivatecatalog", - "name_pretty": "Private Catalog V1beta1 API", - "product_documentation": "https://cloud.google.com/private-catalog/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. Note that google-cloud-private_catalog-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-private_catalog instead. See the readme for more details.", - "ruby-cloud-env-prefix": "PRIVATE_CATALOG", - "ruby-cloud-product-url": "https://cloud.google.com/private-catalog/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml deleted file mode 100644 index 709811bdd0ab..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-private_catalog-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-private_catalog-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/.yardopts b/owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts deleted file mode 100644 index 2362fe73205d..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Private Catalog 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-private_catalog-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md deleted file mode 100644 index c3b5087e0c4f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-private_catalog-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-private_catalog-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/private_catalog/v1beta1" - -client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/private_catalog/v1beta1" - -::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog-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/private_catalog/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/README.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md deleted file mode 100644 index 1112c9ba65ef..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Private Catalog V1beta1 API - -Enable cloud users to discover private catalogs and products in their organizations. - -With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Private Catalog V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-private_catalog](https://rubygems.org/gems/google-cloud-private_catalog). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-private_catalog-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/cloudprivatecatalog.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/private_catalog/v1beta1" - -client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new -request = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new # (request fields as keyword arguments...) -response = client.search_catalogs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/private-catalog/) -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/private_catalog/v1beta1" -require "logger" - -client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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-private_catalog`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-private_catalog-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-private_catalog`. -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-private_catalog-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-private_catalog-v1beta1/Rakefile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile deleted file mode 100644 index edb1a7f8207b..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/Rakefile +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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-private_catalog-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PRIVATE_CATALOG_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PRIVATE_CATALOG_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PRIVATE_CATALOG_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_CATALOG_TEST_PROJECT=test123 PRIVATE_CATALOG_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" - ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PRIVATE_CATALOG_PROJECT"] = project - ENV["PRIVATE_CATALOG_TEST_PROJECT"] = project - ENV["PRIVATE_CATALOG_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-private_catalog-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-private_catalog-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-private_catalog-v1beta1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-private_catalog-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-private_catalog-v1beta1" - header "google-cloud-private_catalog-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-private_catalog-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-private_catalog-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-private_catalog-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-private_catalog-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-private_catalog-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json deleted file mode 100644 index eec768d32fcf..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.privatecatalog.v1beta1", - "libraryPackage": "::Google::Cloud::PrivateCatalog::V1beta1", - "services": { - "PrivateCatalog": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client", - "rpcs": { - "SearchCatalogs": { - "methods": [ - "search_catalogs" - ] - }, - "SearchProducts": { - "methods": [ - "search_products" - ] - }, - "SearchVersions": { - "methods": [ - "search_versions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec b/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec deleted file mode 100644 index 90cb5cfa1e3f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/google-cloud-private_catalog-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/private_catalog/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-private_catalog-v1beta1" - gem.version = Google::Cloud::PrivateCatalog::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. Note that google-cloud-private_catalog-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-private_catalog instead. See the readme for more details." - gem.summary = "Enable cloud users to discover private catalogs and products in their organizations." - 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-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-v1beta1.rb deleted file mode 100644 index cd1f53ddc55b..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google-cloud-private_catalog-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/private_catalog/v1beta1" diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1.rb deleted file mode 100644 index a53ec341f0a2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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/private_catalog/v1beta1/private_catalog" -require "google/cloud/private_catalog/v1beta1/version" - -module Google - module Cloud - module PrivateCatalog - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/private_catalog/v1beta1" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/private_catalog/v1beta1" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/private_catalog/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb deleted file mode 100644 index 02ca08f093c4..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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/private_catalog/v1beta1/version" - -require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" -require "google/cloud/private_catalog/v1beta1/private_catalog/client" -require "google/cloud/private_catalog/v1beta1/private_catalog/rest" - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - ## - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/private_catalog/v1beta1/private_catalog" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/private_catalog/v1beta1/private_catalog/rest" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - module PrivateCatalog - end - end - end - end -end - -helper_path = ::File.join __dir__, "private_catalog", "helpers.rb" -require "google/cloud/private_catalog/v1beta1/private_catalog/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb deleted file mode 100644 index 8e74775b6691..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/client.rb +++ /dev/null @@ -1,738 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - module PrivateCatalog - ## - # Client for the PrivateCatalog service. - # - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprivatecatalog.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :private_catalog_stub - - ## - # Configure the PrivateCatalog Client class. - # - # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrivateCatalog clients - # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "PrivateCatalog", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrivateCatalog Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @private_catalog_stub.universe_domain - end - - ## - # Create a new PrivateCatalog client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrivateCatalog 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/privatecatalog/v1beta1/private_catalog_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 - - @private_catalog_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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 - ) - - @private_catalog_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 - @private_catalog_stub.logger - end - - # Service calls - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Catalog Catalog} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_catalogs(request, options = nil) - # Pass arguments to `search_catalogs` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalogs(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. It can be in following formats: - # - # * `projects/{project}` - # * `folders/{folder}` - # * `organizations/{organization}` - # @param query [::String] - # The query to filter the catalogs. The supported queries are: - # - # * Get a single catalog: `name=catalogs/{catalog}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchCatalogs 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::PrivateCatalog::V1beta1::Catalog>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new - # - # # Call the search_catalogs method. - # result = client.search_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::PrivateCatalog::V1beta1::Catalog. - # p item - # end - # - def search_catalogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest - - # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION - metadata[:"x-goog-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.search_catalogs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_catalogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.call_rpc :search_catalogs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Product Product} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_products(request, options = nil) - # Pass arguments to `search_products` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @param query [::String] - # The query to filter the products. - # - # The supported queries are: - # * List products of all catalogs: empty - # * List products under a catalog: `parent=catalogs/{catalog}` - # * Get a product by name: - # `name=catalogs/{catalog}/products/{product}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchProducts 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::PrivateCatalog::V1beta1::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new - # - # # Call the search_products method. - # result = client.search_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::PrivateCatalog::V1beta1::Product. - # p item - # end - # - def search_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest - - # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION - metadata[:"x-goog-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.search_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.call_rpc :search_products, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Version Version} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_versions(request, options = nil) - # Pass arguments to `search_versions` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_versions(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @param query [::String] - # Required. The query to filter the versions. - # - # The supported queries are: - # * List versions under a product: - # `parent=catalogs/{catalog}/products/{product}` - # * Get a version by name: - # `name=catalogs/{catalog}/products/{product}/versions/{version}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchVersions - # 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::PrivateCatalog::V1beta1::Version>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Version>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new - # - # # Call the search_versions method. - # result = client.search_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::PrivateCatalog::V1beta1::Version. - # p item - # end - # - def search_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest - - # Converts hash and nil to 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_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::PrivateCatalog::V1beta1::VERSION - metadata[:"x-goog-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.search_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.call_rpc :search_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Configuration class for the PrivateCatalog API. - # - # This class represents the configuration for PrivateCatalog, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_catalogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search_catalogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search_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::PrivateCatalog::V1beta1::PrivateCatalog::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 = "cloudprivatecatalog.googleapis.com" - - config_attr :endpoint, nil, ::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 PrivateCatalog API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_catalogs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_catalogs - ## - # RPC-specific configuration for `search_products` - # @return [::Gapic::Config::Method] - # - attr_reader :search_products - ## - # RPC-specific configuration for `search_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_versions - - # @private - def initialize parent_rpcs = nil - search_catalogs_config = parent_rpcs.search_catalogs if parent_rpcs.respond_to? :search_catalogs - @search_catalogs = ::Gapic::Config::Method.new search_catalogs_config - search_products_config = parent_rpcs.search_products if parent_rpcs.respond_to? :search_products - @search_products = ::Gapic::Config::Method.new search_products_config - search_versions_config = parent_rpcs.search_versions if parent_rpcs.respond_to? :search_versions - @search_versions = ::Gapic::Config::Method.new search_versions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/credentials.rb deleted file mode 100644 index 14bdc9599325..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/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 PrivateCatalog - module V1beta1 - module PrivateCatalog - # Credentials for the PrivateCatalog API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "PRIVATE_CATALOG_CREDENTIALS", - "PRIVATE_CATALOG_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PRIVATE_CATALOG_CREDENTIALS_JSON", - "PRIVATE_CATALOG_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-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.rb deleted file mode 100644 index 96b9df075ca1..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/private_catalog/v1beta1/version" - -require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" -require "google/cloud/private_catalog/v1beta1/private_catalog/rest/client" - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - ## - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/private_catalog/v1beta1/private_catalog/rest" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - module PrivateCatalog - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/private_catalog/v1beta1/private_catalog/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb deleted file mode 100644 index 1922e509478f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/client.rb +++ /dev/null @@ -1,674 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" -require "google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub" - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - module PrivateCatalog - module Rest - ## - # REST client for the PrivateCatalog service. - # - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprivatecatalog.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :private_catalog_stub - - ## - # Configure the PrivateCatalog Client class. - # - # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrivateCatalog clients - # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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", "PrivateCatalog", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrivateCatalog Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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 - @private_catalog_stub.universe_domain - end - - ## - # Create a new PrivateCatalog REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrivateCatalog 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 - - @private_catalog_stub = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @private_catalog_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 - @private_catalog_stub.logger - end - - # Service calls - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Catalog Catalog} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_catalogs(request, options = nil) - # Pass arguments to `search_catalogs` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalogs(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. It can be in following formats: - # - # * `projects/{project}` - # * `folders/{folder}` - # * `organizations/{organization}` - # @param query [::String] - # The query to filter the catalogs. The supported queries are: - # - # * Get a single catalog: `name=catalogs/{catalog}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchCatalogs 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::PrivateCatalog::V1beta1::Catalog>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new - # - # # Call the search_catalogs method. - # result = client.search_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::PrivateCatalog::V1beta1::Catalog. - # p item - # end - # - def search_catalogs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest - - # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_catalogs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_catalogs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.search_catalogs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Product Product} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_products(request, options = nil) - # Pass arguments to `search_products` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @param query [::String] - # The query to filter the products. - # - # The supported queries are: - # * List products of all catalogs: empty - # * List products under a catalog: `parent=catalogs/{catalog}` - # * Get a product by name: - # `name=catalogs/{catalog}/products/{product}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchProducts 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::PrivateCatalog::V1beta1::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new - # - # # Call the search_products method. - # result = client.search_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::PrivateCatalog::V1beta1::Product. - # p item - # end - # - def search_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest - - # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.search_products request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Search {::Google::Cloud::PrivateCatalog::V1beta1::Version Version} resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - # - # @overload search_versions(request, options = nil) - # Pass arguments to `search_versions` via a request object, either of type - # {::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_versions(resource: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_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 resource [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @param query [::String] - # Required. The query to filter the versions. - # - # The supported queries are: - # * List versions under a product: - # `parent=catalogs/{catalog}/products/{product}` - # * Get a version by name: - # `name=catalogs/{catalog}/products/{product}/versions/{version}` - # @param page_size [::Integer] - # The maximum number of entries that are requested. - # @param page_token [::String] - # A pagination token returned from a previous call to SearchVersions - # 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::PrivateCatalog::V1beta1::Version>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivateCatalog::V1beta1::Version>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/private_catalog/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new - # - # # Call the search_versions method. - # result = client.search_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::PrivateCatalog::V1beta1::Version. - # p item - # end - # - def search_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest - - # Converts hash and nil to an 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_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::PrivateCatalog::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @private_catalog_stub.search_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @private_catalog_stub, :search_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 - - ## - # Configuration class for the PrivateCatalog REST API. - # - # This class represents the configuration for PrivateCatalog 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::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search_catalogs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search_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 = "cloudprivatecatalog.googleapis.com" - - config_attr :endpoint, nil, ::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 PrivateCatalog API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_catalogs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_catalogs - ## - # RPC-specific configuration for `search_products` - # @return [::Gapic::Config::Method] - # - attr_reader :search_products - ## - # RPC-specific configuration for `search_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_versions - - # @private - def initialize parent_rpcs = nil - search_catalogs_config = parent_rpcs.search_catalogs if parent_rpcs.respond_to? :search_catalogs - @search_catalogs = ::Gapic::Config::Method.new search_catalogs_config - search_products_config = parent_rpcs.search_products if parent_rpcs.respond_to? :search_products - @search_products = ::Gapic::Config::Method.new search_products_config - search_versions_config = parent_rpcs.search_versions if parent_rpcs.respond_to? :search_versions - @search_versions = ::Gapic::Config::Method.new search_versions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb deleted file mode 100644 index 61885c21605f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb +++ /dev/null @@ -1,306 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - module PrivateCatalog - module Rest - ## - # REST service stub for the PrivateCatalog 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_catalogs REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse] - # A result object deserialized from the server's reply - def search_catalogs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_catalogs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.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_products REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse] - # A result object deserialized from the server's reply - def search_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_products", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.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_versions REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse] - # A result object deserialized from the server's reply - def search_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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: "search_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.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_catalogs REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest] - # 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_catalogs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/catalogs:search", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/catalogs:search", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/catalogs:search", - matches: [ - ["resource", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_products REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest] - # 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_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/products:search", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/products:search", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/products:search", - matches: [ - ["resource", %r{^folders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_versions REST call - # - # @param request_pb [::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest] - # 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_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/versions:search", - matches: [ - ["resource", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/versions:search", - matches: [ - ["resource", %r{^organizations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{resource}/versions:search", - 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-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/rest.rb deleted file mode 100644 index 515801f56a70..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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/private_catalog/v1beta1/private_catalog/rest" -require "google/cloud/private_catalog/v1beta1/version" - -module Google - module Cloud - module PrivateCatalog - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/private_catalog/v1beta1/rest" - # client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/version.rb deleted file mode 100644 index 90c36fd71e0f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/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 PrivateCatalog - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb deleted file mode 100644 index 542c71cd7f3e..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_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/privatecatalog/v1beta1/private_catalog.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/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n9google/cloud/privatecatalog/v1beta1/private_catalog.proto\x12#google.cloud.privatecatalog.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\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"d\n\x15SearchCatalogsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchCatalogsResponse\x12>\n\x08\x63\x61talogs\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Catalog\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x15SearchProductsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05query\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchProductsResponse\x12>\n\x08products\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x15SearchVersionsRequest\x12\x15\n\x08resource\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"q\n\x16SearchVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.privatecatalog.v1beta1.Version\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x82\x02\n\x07\x43\x61talog\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\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:C\xea\x41@\n*cloudprivatecatalog.googleapis.com/Catalog\x12\x12\x63\x61talogs/{catalog}\"\x8c\x03\n\x07Product\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nasset_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10\x64isplay_metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x06\xe0\x41\x02\xe0\x41\x03\x12\x15\n\x08icon_uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12R\n\x10\x61sset_references\x18\n \x03(\x0b\x32\x33.google.cloud.privatecatalog.v1beta1.AssetReferenceB\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:C\xea\x41@\n*cloudprivatecatalog.googleapis.com/Product\x12\x12products/{product}\"\xde\x05\n\x0e\x41ssetReference\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12@\n\x06inputs\x18\x06 \x01(\x0b\x32+.google.cloud.privatecatalog.v1beta1.InputsB\x03\xe0\x41\x03\x12h\n\x11validation_status\x18\x07 \x01(\x0e\x32H.google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationStateB\x03\xe0\x41\x03\x12@\n\x14validation_operation\x18\x08 \x01(\x0b\x32\x1d.google.longrunning.OperationB\x03\xe0\x41\x03\x12\x14\n\x05\x61sset\x18\n \x01(\tB\x03\xe0\x41\x03H\x00\x12\x19\n\x08gcs_path\x18\x0b \x01(\tB\x05\x18\x01\xe0\x41\x03H\x00\x12I\n\ngit_source\x18\x0f \x01(\x0b\x32..google.cloud.privatecatalog.v1beta1.GitSourceB\x03\xe0\x41\x03H\x00\x12G\n\ngcs_source\x18\x10 \x01(\x0b\x32..google.cloud.privatecatalog.v1beta1.GcsSourceB\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\x12\x13\n\x07version\x18\x0e \x01(\tB\x02\x18\x01\"c\n\x14\x41ssetValidationState\x12&\n\"ASSET_VALIDATION_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\t\n\x05VALID\x10\x02\x12\x0b\n\x07INVALID\x10\x03\x42\x08\n\x06source\":\n\x06Inputs\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\"q\n\tGcsSource\x12\x15\n\x08gcs_path\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\ngeneration\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"`\n\tGitSource\x12\x0c\n\x04repo\x18\x01 \x01(\t\x12\x0b\n\x03\x64ir\x18\x02 \x01(\t\x12\x10\n\x06\x63ommit\x18\x03 \x01(\tH\x00\x12\x10\n\x06\x62ranch\x18\x04 \x01(\tH\x00\x12\r\n\x03tag\x18\x05 \x01(\tH\x00\x42\x05\n\x03ref\"\xba\x02\n\x07Version\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12+\n\x05\x61sset\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\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:i\xea\x41\x66\n*cloudprivatecatalog.googleapis.com/Version\x12\x38\x63\x61talogs/{catalog}/products/{product}/versions/{version}2\xf2\x07\n\x0ePrivateCatalog\x12\xab\x02\n\x0eSearchCatalogs\x12:.google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/catalogs:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/catalogs:searchZ/\x12-/v1beta1/{resource=folders/*}/catalogs:search\x12\xab\x02\n\x0eSearchProducts\x12:.google.cloud.privatecatalog.v1beta1.SearchProductsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchProductsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/products:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/products:searchZ/\x12-/v1beta1/{resource=folders/*}/products:search\x12\xab\x02\n\x0eSearchVersions\x12:.google.cloud.privatecatalog.v1beta1.SearchVersionsRequest\x1a;.google.cloud.privatecatalog.v1beta1.SearchVersionsResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12./v1beta1/{resource=projects/*}/versions:searchZ5\x12\x33/v1beta1/{resource=organizations/*}/versions:searchZ/\x12-/v1beta1/{resource=folders/*}/versions:search\x1aV\xca\x41\"cloudprivatecatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n\'com.google.cloud.privatecatalog.v1beta1B\x13PrivateCatalogProtoP\x01ZOcloud.google.com/go/privatecatalog/apiv1beta1/privatecatalogpb;privatecatalogpb\xaa\x02#Google.Cloud.PrivateCatalog.V1Beta1\xca\x02#Google\\Cloud\\PrivateCatalog\\V1beta1\xea\x02&Google::Cloud::PrivateCatalog::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.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.longrunning.Operation", "google/longrunning/operations.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 PrivateCatalog - module V1beta1 - SearchCatalogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest").msgclass - SearchCatalogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse").msgclass - SearchProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchProductsRequest").msgclass - SearchProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchProductsResponse").msgclass - SearchVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchVersionsRequest").msgclass - SearchVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.SearchVersionsResponse").msgclass - Catalog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Catalog").msgclass - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Product").msgclass - AssetReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.AssetReference").msgclass - AssetReference::AssetValidationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.AssetReference.AssetValidationState").enummodule - Inputs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Inputs").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.GcsSource").msgclass - GitSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.GitSource").msgclass - Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privatecatalog.v1beta1.Version").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb deleted file mode 100644 index 25a007cc31fc..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/privatecatalog/v1beta1/private_catalog.proto for package 'Google.Cloud.PrivateCatalog.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/privatecatalog/v1beta1/private_catalog_pb' - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - module PrivateCatalog - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.privatecatalog.v1beta1.PrivateCatalog' - - # Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - rpc :SearchCatalogs, ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse - # Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - rpc :SearchProducts, ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse - # Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the - # scope of the consumer cloud resource hierarchy context. - rpc :SearchVersions, ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md deleted file mode 100644 index 12926d84ac6d..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Private Catalog 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-private_catalog-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb deleted file mode 100644 index 26e75b65725b..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb +++ /dev/null @@ -1,506 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PrivateCatalog - module V1beta1 - # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs PrivateCatalog.SearchCatalogs}. - # @!attribute [rw] resource - # @return [::String] - # Required. The name of the resource context. It can be in following formats: - # - # * `projects/{project}` - # * `folders/{folder}` - # * `organizations/{organization}` - # @!attribute [rw] query - # @return [::String] - # The query to filter the catalogs. The supported queries are: - # - # * Get a single catalog: `name=catalogs/{catalog}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of entries that are requested. - # @!attribute [rw] page_token - # @return [::String] - # A pagination token returned from a previous call to SearchCatalogs that - # indicates where this listing should continue from. - class SearchCatalogsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs PrivateCatalog.SearchCatalogs}. - # @!attribute [rw] catalogs - # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Catalog>] - # The `Catalog`s computed from the resource context. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to SearchCatalogs that - # indicates from where listing should continue. - class SearchCatalogsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products PrivateCatalog.SearchProducts}. - # @!attribute [rw] resource - # @return [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @!attribute [rw] query - # @return [::String] - # The query to filter the products. - # - # The supported queries are: - # * List products of all catalogs: empty - # * List products under a catalog: `parent=catalogs/{catalog}` - # * Get a product by name: - # `name=catalogs/{catalog}/products/{product}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of entries that are requested. - # @!attribute [rw] page_token - # @return [::String] - # A pagination token returned from a previous call to SearchProducts that - # indicates where this listing should continue from. - class SearchProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products PrivateCatalog.SearchProducts}. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Product>] - # The `Product` resources computed from the resource context. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to SearchProducts that - # indicates from where listing should continue. - class SearchProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions PrivateCatalog.SearchVersions}. - # @!attribute [rw] resource - # @return [::String] - # Required. The name of the resource context. See {::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest#resource SearchCatalogsRequest.resource} - # for details. - # @!attribute [rw] query - # @return [::String] - # Required. The query to filter the versions. - # - # The supported queries are: - # * List versions under a product: - # `parent=catalogs/{catalog}/products/{product}` - # * Get a version by name: - # `name=catalogs/{catalog}/products/{product}/versions/{version}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of entries that are requested. - # @!attribute [rw] page_token - # @return [::String] - # A pagination token returned from a previous call to SearchVersions - # that indicates where this listing should continue from. - class SearchVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for {::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions PrivateCatalog.SearchVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::Version>] - # The `Version` resources computed from the resource context. - # @!attribute [rw] next_page_token - # @return [::String] - # A pagination token returned from a previous call to SearchVersions that - # indicates from where the listing should continue. - class SearchVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The readonly representation of a catalog computed with a given resource - # context. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the target catalog, in the format of - # `catalogs/{catalog}`. - # @!attribute [r] display_name - # @return [::String] - # Output only. The descriptive name of the catalog as it appears in UIs. - # @!attribute [r] description - # @return [::String] - # Output only. The description of the catalog. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the catalog was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the catalog was last updated. - class Catalog - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The readonly representation of a product computed with a given resource - # context. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the target product, in the format of - # `products/[a-z][-a-z0-9]*[a-z0-9]'. - # - # A unique identifier for the product under a catalog. - # @!attribute [r] asset_type - # @return [::String] - # Output only. The type of the product asset. It can be one of the following values: - # - # * `google.deploymentmanager.Template` - # * `google.cloudprivatecatalog.ListingOnly` - # * `google.cloudprivatecatalog.Terraform` - # @!attribute [r] display_metadata - # @return [::Google::Protobuf::Struct] - # Required. Output only. The display metadata to describe the product. The JSON schema of the - # metadata differs by {::Google::Cloud::PrivateCatalog::V1beta1::Product#asset_type Product.asset_type}. - # When the type is `google.deploymentmanager.Template`, the schema is as - # follows: - # - # ``` - # "$schema": http://json-schema.org/draft-04/schema# - # type: object - # properties: - # name: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # tagline: - # type: string - # minLength: 1 - # maxLength: 100 - # support_info: - # type: string - # minLength: 1 - # maxLength: 2048 - # creator: - # type: string - # minLength: 1 - # maxLength: 100 - # documentations: - # type: array - # items: - # type: object - # properties: - # url: - # type: string - # pattern: - # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - # title: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # required: - # - name - # - description - # additionalProperties: false - # - # ``` - # - # When the asset type is `google.cloudprivatecatalog.ListingOnly`, the schema - # is as follows: - # - # ``` - # "$schema": http://json-schema.org/draft-04/schema# - # type: object - # properties: - # name: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # tagline: - # type: string - # minLength: 1 - # maxLength: 100 - # support_info: - # type: string - # minLength: 1 - # maxLength: 2048 - # creator: - # type: string - # minLength: 1 - # maxLength: 100 - # documentations: - # type: array - # items: - # type: object - # properties: - # url: - # type: string - # pattern: - # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - # title: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # signup_url: - # type: string - # pattern: - # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - # required: - # - name - # - description - # - signup_url - # additionalProperties: false - # - # ``` - # - # When the asset type is `google.cloudprivatecatalog.Terraform`, the schema - # is as follows: - # - # ``` - # "$schema": http://json-schema.org/draft-04/schema# - # type: object - # properties: - # name: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # tagline: - # type: string - # minLength: 1 - # maxLength: 100 - # support_info: - # type: string - # minLength: 1 - # maxLength: 2048 - # creator: - # type: string - # minLength: 1 - # maxLength: 100 - # documentations: - # type: array - # items: - # type: object - # properties: - # url: - # type: string - # pattern: - # "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" - # title: - # type: string - # minLength: 1 - # maxLength: 64 - # description: - # type: string - # minLength: 1 - # maxLength: 2048 - # required: - # - name - # - description - # additionalProperties: true - # @!attribute [r] icon_uri - # @return [::String] - # Output only. The icon URI of the product. - # @!attribute [r] asset_references - # @return [::Array<::Google::Cloud::PrivateCatalog::V1beta1::AssetReference>] - # Output only. A collection of assets referred by a product. - # This field is set for Terraform Products only. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the product was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the product was last updated. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the reference of an asset belonging to a product. - # @!attribute [r] id - # @return [::String] - # Output only. A unique identifier among asset references in a product. - # @!attribute [r] description - # @return [::String] - # Output only. The human-readable description of the referenced asset. Maximum 256 - # characters in length. - # @!attribute [r] inputs - # @return [::Google::Cloud::PrivateCatalog::V1beta1::Inputs] - # Output only. The definition of input parameters to hydrate the asset template. - # @!attribute [r] validation_status - # @return [::Google::Cloud::PrivateCatalog::V1beta1::AssetReference::AssetValidationState] - # Output only. The current state of the asset reference. - # @!attribute [r] validation_operation - # @return [::Google::Longrunning::Operation] - # Output only. The validation process metadata. - # @!attribute [r] asset - # @return [::String] - # Output only. The asset resource name if an asset is hosted by Private Catalog. - # - # Note: The following fields are mutually exclusive: `asset`, `gcs_path`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] gcs_path - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. The cloud storage object path. - # - # Note: The following fields are mutually exclusive: `gcs_path`, `asset`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] git_source - # @return [::Google::Cloud::PrivateCatalog::V1beta1::GitSource] - # Output only. The git source. - # - # Note: The following fields are mutually exclusive: `git_source`, `asset`, `gcs_path`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] gcs_source - # @return [::Google::Cloud::PrivateCatalog::V1beta1::GcsSource] - # Output only. The cloud storage source. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation timestamp of the asset reference. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last update timestamp of the asset reference. - # @!attribute [rw] version - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # The version of the source used for this asset reference. - class AssetReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible validation steates of an asset reference. - module AssetValidationState - # Unknown state. - ASSET_VALIDATION_STATE_UNSPECIFIED = 0 - - # The validation is still in process. - PENDING = 1 - - # The validation is done and the asset reference is valid. - VALID = 2 - - # The validation is done and the asset reference is invalid. - INVALID = 3 - end - end - - # Defines definition of input parameters of asset templates. - # @!attribute [r] parameters - # @return [::Google::Protobuf::Struct] - # Output only. The JSON schema defining the inputs and their formats. - class Inputs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines how to access Cloud Storage source. - # @!attribute [r] gcs_path - # @return [::String] - # Output only. the cloud storage object path. - # @!attribute [r] generation - # @return [::Integer] - # Output only. Generation of the object, which is set when the content of an object starts - # being written. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the object metadata was last changed. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines how to access a Git Source. - # @!attribute [rw] repo - # @return [::String] - # Location of the Git repo to build. - # @!attribute [rw] dir - # @return [::String] - # Directory, relative to the source root, in which to run the build. - # - # This must be a relative path. If a step's `dir` is specified and is an - # absolute path, this value is ignored for that step's execution. - # @!attribute [rw] commit - # @return [::String] - # The revision commit to use. - # - # Note: The following fields are mutually exclusive: `commit`, `branch`, `tag`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] branch - # @return [::String] - # The revision branch to use. - # - # Note: The following fields are mutually exclusive: `branch`, `commit`, `tag`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tag - # @return [::String] - # The revision tag to use. - # - # Note: The following fields are mutually exclusive: `tag`, `commit`, `branch`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class GitSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The consumer representation of a version which is a child resource under a - # `Product` with asset data. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the version, in the format - # `catalogs/{catalog}/products/{product}/versions/[a-z][-a-z0-9]*[a-z0-9]`. - # - # A unique identifier for the version under a product. - # @!attribute [r] description - # @return [::String] - # Output only. The user-supplied description of the version. Maximum of 256 - # characters. - # @!attribute [r] asset - # @return [::Google::Protobuf::Struct] - # Output only. The asset which has been validated and is ready to be - # provisioned. See - # [google.cloud.privatecatalogproducer.v1beta.Version.asset][] for details. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the version was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the version was last updated. - class Version - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/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-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/Gemfile deleted file mode 100644 index db299e20cc99..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog-v1beta1", path: "../" -else - gem "google-cloud-private_catalog-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-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb deleted file mode 100644 index 34578aef9f37..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] -require "google/cloud/private_catalog/v1beta1" - -## -# Snippet for the search_catalogs call in the PrivateCatalog service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs. -# -def search_catalogs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new - - # Call the search_catalogs method. - result = client.search_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::PrivateCatalog::V1beta1::Catalog. - p item - end -end -# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb deleted file mode 100644 index fabb9ad7546f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] -require "google/cloud/private_catalog/v1beta1" - -## -# Snippet for the search_products call in the PrivateCatalog service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products. -# -def search_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new - - # Call the search_products method. - result = client.search_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::PrivateCatalog::V1beta1::Product. - p item - end -end -# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb deleted file mode 100644 index 84d57f05f511..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_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 cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] -require "google/cloud/private_catalog/v1beta1" - -## -# Snippet for the search_versions call in the PrivateCatalog service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions. -# -def search_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new - - # Call the search_versions method. - result = client.search_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::PrivateCatalog::V1beta1::Version. - p item - end -end -# [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json b/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json deleted file mode 100644 index f8b5399663ab..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-private_catalog-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.privatecatalog.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync", - "title": "Snippet for the search_catalogs call in the PrivateCatalog service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs.", - "file": "private_catalog/search_catalogs.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_catalogs", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse", - "client": { - "short_name": "PrivateCatalog::Client", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" - }, - "method": { - "short_name": "SearchCatalogs", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs", - "service": { - "short_name": "PrivateCatalog", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync", - "title": "Snippet for the search_products call in the PrivateCatalog service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products.", - "file": "private_catalog/search_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_products", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse", - "client": { - "short_name": "PrivateCatalog::Client", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" - }, - "method": { - "short_name": "SearchProducts", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts", - "service": { - "short_name": "PrivateCatalog", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync", - "title": "Snippet for the search_versions call in the PrivateCatalog service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions.", - "file": "private_catalog/search_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_versions", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse", - "client": { - "short_name": "PrivateCatalog::Client", - "full_name": "::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client" - }, - "method": { - "short_name": "SearchVersions", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions", - "service": { - "short_name": "PrivateCatalog", - "full_name": "google.cloud.privatecatalog.v1beta1.PrivateCatalog" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb deleted file mode 100644 index ca3d8dfc853f..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb +++ /dev/null @@ -1,270 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/privatecatalog/v1beta1/private_catalog_pb" -require "google/cloud/private_catalog/v1beta1/private_catalog/rest" - - -class ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs - # Create test objects. - client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_catalogs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_catalogs_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_catalogs resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_catalogs ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_catalogs(::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_catalogs_client_stub.call_count - end - end - end - - def test_search_products - # Create test objects. - client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_products_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_products resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_products ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_products(::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_products_client_stub.call_count - end - end - end - - def test_search_versions - # Create test objects. - client_result = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::ServiceStub.stub :transcode_search_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_versions_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_versions resource: resource, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_versions ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_versions(::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_versions_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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb deleted file mode 100644 index 22364fedecae..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb +++ /dev/null @@ -1,311 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/privatecatalog/v1beta1/private_catalog_pb" -require "google/cloud/private_catalog/v1beta1/private_catalog" - -class ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::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_catalogs - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_catalogs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_catalogs, name - assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest, request - assert_equal "hello world", request["resource"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_catalogs_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_catalogs resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_catalogs ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_catalogs({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_catalogs(::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_catalogs_client_stub.call_rpc_count - end - end - - def test_search_products - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_products, name - assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest, request - assert_equal "hello world", request["resource"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_products_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_products resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_products ::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_products({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_products(::Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_products_client_stub.call_rpc_count - end - end - - def test_search_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_versions, name - assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_versions_client_stub do - # Create client - client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_versions resource: resource, query: query, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_versions ::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_versions({ resource: resource, query: query, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_versions(::Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new(resource: resource, query: query, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_versions_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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::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::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-private_catalog-v1beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog-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-private_catalog/.gitignore b/owl-bot-staging/google-cloud-private_catalog/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/.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-private_catalog/.repo-metadata.json b/owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json deleted file mode 100644 index c79da2444afc..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudprivatecatalog.googleapis.com", - "api_shortname": "cloudprivatecatalog", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog/latest", - "distribution_name": "google-cloud-private_catalog", - "is_cloud": true, - "language": "ruby", - "name": "cloudprivatecatalog", - "name_pretty": "Private Catalog API", - "product_documentation": "https://cloud.google.com/private-catalog/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions.", - "ruby-cloud-env-prefix": "PRIVATE_CATALOG", - "ruby-cloud-product-url": "https://cloud.google.com/private-catalog/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml b/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml deleted file mode 100644 index aa19d4f0b67e..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-private_catalog.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-private_catalog.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-private_catalog/.toys.rb b/owl-bot-staging/google-cloud-private_catalog/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/.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-private_catalog/.yardopts b/owl-bot-staging/google-cloud-private_catalog/.yardopts deleted file mode 100644 index 3550f0f7990c..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Private Catalog 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-private_catalog/AUTHENTICATION.md b/owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md deleted file mode 100644 index 408135d89769..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-private_catalog 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-private_catalog 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/private_catalog" - -client = Google::Cloud::PrivateCatalog.private_catalog do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/private_catalog" - -Google::Cloud::PrivateCatalog.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::PrivateCatalog.private_catalog -``` - -### 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-private_catalog -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/private_catalog" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::PrivateCatalog.private_catalog -``` - -### 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-private_catalog/CHANGELOG.md b/owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-private_catalog/Gemfile b/owl-bot-staging/google-cloud-private_catalog/Gemfile deleted file mode 100644 index 990f39dd582a..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-private_catalog-v1beta1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-private_catalog.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-private_catalog/LICENSE.md b/owl-bot-staging/google-cloud-private_catalog/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/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-private_catalog/README.md b/owl-bot-staging/google-cloud-private_catalog/README.md deleted file mode 100644 index 3c60d74a9187..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Private Catalog API - -API Client library for the Private Catalog API - -With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-private_catalog-v*`. -The gem `google-cloud-private_catalog` 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-private_catalog/latest) -for this library, google-cloud-private_catalog, 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-private_catalog-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest). - -See also the [Product Documentation](https://cloud.google.com/private-catalog/) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-private_catalog -``` - -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/cloudprivatecatalog.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/private_catalog" - -client = Google::Cloud::PrivateCatalog.private_catalog -request = ::Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new # (request fields as keyword arguments...) -response = client.search_catalogs 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-private_catalog-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-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-private_catalog`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-private_catalog-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-private_catalog`. -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-private_catalog-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-private_catalog/Rakefile b/owl-bot-staging/google-cloud-private_catalog/Rakefile deleted file mode 100644 index 53d72b9896f8..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/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-private_catalog acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PRIVATE_CATALOG_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PRIVATE_CATALOG_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PRIVATE_CATALOG_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_CATALOG_TEST_PROJECT=test123 PRIVATE_CATALOG_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/private_catalog/v1beta1/private_catalog/credentials" - ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PRIVATE_CATALOG_PROJECT"] = project - ENV["PRIVATE_CATALOG_TEST_PROJECT"] = project - ENV["PRIVATE_CATALOG_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-private_catalog 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-private_catalog 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-private_catalog 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-private_catalog gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-private_catalog" - header "google-cloud-private_catalog rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-private_catalog yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-private_catalog 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-private_catalog 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-private_catalog 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-private_catalog/google-cloud-private_catalog.gemspec b/owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec deleted file mode 100644 index b345acf533b2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/google-cloud-private_catalog.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/private_catalog/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-private_catalog" - gem.version = Google::Cloud::PrivateCatalog::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "With Private Catalog, developers and cloud admins can make their solutions discoverable to their internal enterprise users. Cloud admins can manage their solutions and ensure their users are always launching the latest versions." - gem.summary = "API Client library for the Private Catalog 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-private_catalog-v1beta1", ">= 0.6", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.rb deleted file mode 100644 index 3ca9f4cd94c2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/lib/google-cloud-private_catalog.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/private_catalog" unless defined? Google::Cloud::PrivateCatalog::VERSION diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.rb deleted file mode 100644 index 93931800cb10..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog.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 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/private_catalog/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! :private_catalog 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 PrivateCatalog - ## - # Create a new client object for PrivateCatalog. - # - # By default, this returns an instance of - # [Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-private_catalog-v1beta1/latest/Google-Cloud-PrivateCatalog-V1beta1-PrivateCatalog-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 PrivateCatalog 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 PrivateCatalog service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::PrivateCatalog.private_catalog_available?}. - # - # ## About PrivateCatalog - # - # `PrivateCatalog` allows catalog consumers to retrieve `Catalog`, `Product` - # and `Version` resources under a target resource context. - # - # `Catalog` is computed based on the [Association][]s linked to the target - # resource and its ancestors. Each association's - # [google.cloud.privatecatalogproducer.v1beta.Catalog][] is transformed into a - # `Catalog`. If multiple associations have the same parent - # [google.cloud.privatecatalogproducer.v1beta.Catalog][], they are - # de-duplicated into one `Catalog`. Users must have - # `cloudprivatecatalog.catalogTargets.get` IAM permission on the resource - # context in order to access catalogs. `Catalog` contains the resource name and - # a subset of data of the original - # [google.cloud.privatecatalogproducer.v1beta.Catalog][]. - # - # `Product` is child resource of the catalog. A `Product` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Product][]. - # - # `Version` is child resource of the product. A `Version` contains the resource - # name and a subset of the data of the original - # [google.cloud.privatecatalogproducer.v1beta.Version][]. - # - # @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.private_catalog version: :v1beta1, transport: :grpc, &block - require "google/cloud/private_catalog/#{version.to_s.downcase}" - - package_name = Google::Cloud::PrivateCatalog - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::PrivateCatalog.const_get(package_name).const_get(:PrivateCatalog) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PrivateCatalog service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::PrivateCatalog.private_catalog}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PrivateCatalog service, - # or if the versioned client gem needs an update to support the PrivateCatalog 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.private_catalog_available? version: :v1beta1, transport: :grpc - require "google/cloud/private_catalog/#{version.to_s.downcase}" - package_name = Google::Cloud::PrivateCatalog - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::PrivateCatalog.const_get package_name - return false unless service_module.const_defined? :PrivateCatalog - service_module = service_module.const_get :PrivateCatalog - 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-private_catalog 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.private_catalog if block_given? - - ::Google::Cloud.configure.private_catalog - end - end - end -end - -helper_path = ::File.join __dir__, "private_catalog", "helpers.rb" -require "google/cloud/private_catalog/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb b/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/version.rb deleted file mode 100644 index 39ede99747f1..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/lib/google/cloud/private_catalog/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 PrivateCatalog - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/client_test.rb deleted file mode 100644 index 7188011b20f4..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/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/private_catalog" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::PrivateCatalog::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_private_catalog_grpc - skip unless Google::Cloud::PrivateCatalog.private_catalog_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::PrivateCatalog.private_catalog transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client, client - end - end - - def test_private_catalog_rest - skip unless Google::Cloud::PrivateCatalog.private_catalog_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::PrivateCatalog.private_catalog transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb b/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/version_test.rb deleted file mode 100644 index 99cdfaacf464..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/test/google/cloud/private_catalog/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/private_catalog/version" - -class Google::Cloud::PrivateCatalog::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::PrivateCatalog::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-private_catalog/test/helper.rb b/owl-bot-staging/google-cloud-private_catalog/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-private_catalog/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-privileged_access_manager-v1/.gitignore b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json deleted file mode 100644 index 7c7c8627c372..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "privilegedaccessmanager.googleapis.com", - "api_shortname": "privilegedaccessmanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest", - "distribution_name": "google-cloud-privileged_access_manager-v1", - "is_cloud": true, - "language": "ruby", - "name": "privilegedaccessmanager", - "name_pretty": "Privileged Access Manager V1 API", - "product_documentation": "https://cloud.google.com/iam/docs/pam-overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes. Note that google-cloud-privileged_access_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-privileged_access_manager instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/pam-overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml deleted file mode 100644 index f7dd4380a15f..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-privileged_access_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-privileged_access_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/.yardopts b/owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts deleted file mode 100644 index af5d864c24be..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Privileged Access 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-privileged_access_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md deleted file mode 100644 index 42bfb575df5d..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1" - -client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/privileged_access_manager/v1" - -::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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/privileged_access_manager/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/README.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md deleted file mode 100644 index 4ccbf222fe3e..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# Ruby Client for the Privileged Access Manager V1 API - -Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more. - -## Overview - -Privileged Access Manager (PAM) is a Google Cloud native, managed solution -to secure, manage and audit privileged access while ensuring operational -velocity and developer productivity. - -PAM enables just-in-time, time-bound, approval-based access elevations, -and auditing of privileged access elevations and activity. PAM lets you -define the rules of who can request access, what they can request access -to, and if they should be granted access with or without approvals based -on the sensitivity of the access and emergency of the situation. - -## Concepts - -### Entitlement - -An entitlement is an eligibility or license that allows specified users -(requesters) to request and obtain access to specified resources subject -to a set of conditions such as duration, etc. entitlements can be granted -to both human and non-human principals. - -### Grant - -A grant is an instance of active usage against the entitlement. A user can -place a request for a grant against an entitlement. The request may be -forwarded to an approver for their decision. Once approved, the grant is -activated, ultimately giving the user access (roles/permissions) on a -resource per the criteria specified in entitlement. - -### How does PAM work - -PAM creates and uses a service agent (Google-managed service account) to -perform the required IAM policy changes for granting access at a -specific -resource/access scope. The service agent requires getIAMPolicy and -setIAMPolicy permissions at the appropriate (or higher) access scope -- -Organization/Folder/Project to make policy changes on the resources listed -in PAM entitlements. - -When enabling PAM for a resource scope, the user/ principal performing -that action should have the appropriate permissions at that resource -scope -(resourcemanager.\\{projects|folders|organizations}.setIamPolicy, -resourcemanager.\\{projects|folders|organizations}.getIamPolicy, and -resourcemanager.\\{projects|folders|organizations}.get) to list and grant -the service agent/account the required access to perform IAM policy -changes. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Privileged Access Manager V1 API. Most users should consider using -the main client gem, -[google-cloud-privileged_access_manager](https://rubygems.org/gems/google-cloud-privileged_access_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-privileged_access_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/privilegedaccessmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/privileged_access_manager/v1" - -client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new -request = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new # (request fields as keyword arguments...) -response = client.check_onboarding_status request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam/docs/pam-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/privileged_access_manager/v1" -require "logger" - -client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1/Rakefile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/Rakefile deleted file mode 100644 index 2eed1b886eca..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1/privileged_access_manager/credentials" - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-privileged_access_manager-v1" - header "google-cloud-privileged_access_manager-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-privileged_access_manager-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json deleted file mode 100644 index 1db4bf616dc5..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.privilegedaccessmanager.v1", - "libraryPackage": "::Google::Cloud::PrivilegedAccessManager::V1", - "services": { - "PrivilegedAccessManager": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client", - "rpcs": { - "CheckOnboardingStatus": { - "methods": [ - "check_onboarding_status" - ] - }, - "ListEntitlements": { - "methods": [ - "list_entitlements" - ] - }, - "SearchEntitlements": { - "methods": [ - "search_entitlements" - ] - }, - "GetEntitlement": { - "methods": [ - "get_entitlement" - ] - }, - "CreateEntitlement": { - "methods": [ - "create_entitlement" - ] - }, - "DeleteEntitlement": { - "methods": [ - "delete_entitlement" - ] - }, - "UpdateEntitlement": { - "methods": [ - "update_entitlement" - ] - }, - "ListGrants": { - "methods": [ - "list_grants" - ] - }, - "SearchGrants": { - "methods": [ - "search_grants" - ] - }, - "GetGrant": { - "methods": [ - "get_grant" - ] - }, - "CreateGrant": { - "methods": [ - "create_grant" - ] - }, - "ApproveGrant": { - "methods": [ - "approve_grant" - ] - }, - "DenyGrant": { - "methods": [ - "deny_grant" - ] - }, - "RevokeGrant": { - "methods": [ - "revoke_grant" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec b/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec deleted file mode 100644 index a5ec6da4e1fc..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/google-cloud-privileged_access_manager-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/privileged_access_manager/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-privileged_access_manager-v1" - gem.version = Google::Cloud::PrivilegedAccessManager::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes. Note that google-cloud-privileged_access_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-privileged_access_manager instead. See the readme for more details." - gem.summary = "Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more." - 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-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_manager-v1.rb deleted file mode 100644 index f746aee733aa..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google-cloud-privileged_access_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/privileged_access_manager/v1" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1.rb deleted file mode 100644 index 27ee76e5a833..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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/privileged_access_manager/v1/privileged_access_manager" -require "google/cloud/privileged_access_manager/v1/version" - -module Google - module Cloud - module PrivilegedAccessManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/privileged_access_manager/v1" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/privileged_access_manager/v1" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/privileged_access_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb deleted file mode 100644 index b09873e2bf4d..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/bindings_override.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 PrivilegedAccessManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/privileged_access_manager/v1/rest" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "PrivilegedAccessManager"] - parent_config = while namespace.any? - parent_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 - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/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 - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^organizations/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^folders/[^/]+/?$}, 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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.rb deleted file mode 100644 index 54d056f430dd..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/privileged_access_manager/v1/version" - -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/paths" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/operations" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/client" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - ## - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/privileged_access_manager/v1/privileged_access_manager" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - module PrivilegedAccessManager - end - end - end - end -end - -helper_path = ::File.join __dir__, "privileged_access_manager", "helpers.rb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb deleted file mode 100644 index e85b2b64e016..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/client.rb +++ /dev/null @@ -1,1940 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" -require "google/cloud/location" - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - ## - # Client for the PrivilegedAccessManager service. - # - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :privileged_access_manager_stub - - ## - # Configure the PrivilegedAccessManager Client class. - # - # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrivilegedAccessManager clients - # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "PrivilegedAccessManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrivilegedAccessManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @privileged_access_manager_stub.universe_domain - end - - ## - # Create a new PrivilegedAccessManager client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrivilegedAccessManager 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/privilegedaccessmanager/v1/privilegedaccessmanager_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 - - @privileged_access_manager_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - ) - - @privileged_access_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 = @privileged_access_manager_stub.endpoint - config.universe_domain = @privileged_access_manager_stub.universe_domain - config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - @privileged_access_manager_stub.logger - end - - # Service calls - - ## - # `CheckOnboardingStatus` reports the onboarding status for a - # project/folder/organization. Any findings reported by this API need to be - # fixed before PAM can be used on the resource. - # - # @overload check_onboarding_status(request, options = nil) - # Pass arguments to `check_onboarding_status` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload check_onboarding_status(parent: nil) - # Pass arguments to `check_onboarding_status` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource for which the onboarding status should be checked. - # Should be in one of the following formats: - # - # * `projects/{project-number|project-id}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `organizations/{organization-number}/locations/{region}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new - # - # # Call the check_onboarding_status method. - # result = client.check_onboarding_status request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. - # p result - # - def check_onboarding_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.check_onboarding_status.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.check_onboarding_status.timeout, - metadata: metadata, - retry_policy: @config.rpcs.check_onboarding_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :check_onboarding_status, request, 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 entitlements in a given project/folder/organization and location. - # - # @overload list_entitlements(request, options = nil) - # Pass arguments to `list_entitlements` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_entitlements` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the entitlement resources. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results. - # @param order_by [::String] - # Optional. Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new - # - # # Call the list_entitlements method. - # result = client.list_entitlements request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p item - # end - # - def list_entitlements request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_entitlements.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_entitlements.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :list_entitlements, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_entitlements, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `SearchEntitlements` returns entitlements on which the caller has the - # specified access. - # - # @overload search_entitlements(request, options = nil) - # Pass arguments to `search_entitlements` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entitlements(parent: nil, caller_access_type: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_entitlements` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the entitlement resources. - # @param caller_access_type [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] - # Required. Only entitlements where the calling user has this access are - # returned. - # @param filter [::String] - # Optional. Only entitlements matching this filter are returned in the - # response. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks 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::PrivilegedAccessManager::V1::Entitlement>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new - # - # # Call the search_entitlements method. - # result = client.search_entitlements request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p item - # end - # - def search_entitlements request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest - - # Converts hash and nil to 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_entitlements.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_entitlements.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_entitlements.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :search_entitlements, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, request, response, 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 entitlement. - # - # @overload get_entitlement(request, options = nil) - # Pass arguments to `get_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_entitlement(name: nil) - # Pass arguments to `get_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Entitlement] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new - # - # # Call the get_entitlement method. - # result = client.get_entitlement request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p result - # - def get_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :get_entitlement, request, 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 entitlement in a given project/folder/organization and - # location. - # - # @overload create_entitlement(request, options = nil) - # Pass arguments to `create_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_entitlement(parent: nil, entitlement_id: nil, entitlement: nil, request_id: nil) - # Pass arguments to `create_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent resource for the entitlement. - # Possible formats: - # - # * `organizations/{organization-number}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `projects/{project-id|project-number}/locations/{region}` - # @param entitlement_id [::String] - # Required. The ID to use for this entitlement. This becomes the last part of - # the resource name. - # - # This value should be 4-63 characters in length, and valid characters are - # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - # - # This value should be unique among all other entitlements under the - # specified `parent`. - # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request and returns the - # previous operation's response. This prevents clients from accidentally - # creating duplicate entitlements. - # - # 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/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new - # - # # Call the create_entitlement method. - # result = client.create_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest - - # Converts hash and nil to 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_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_entitlement.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :create_entitlement, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 entitlement. This method can only be called when there - # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the - # entitlement. - # - # @overload delete_entitlement(request, options = nil) - # Pass arguments to `delete_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_entitlement(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, any child grant under this entitlement is also - # deleted. (Otherwise, the request only works if the entitlement has no child - # grant.) - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new - # - # # Call the delete_entitlement method. - # result = client.delete_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_entitlement.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :delete_entitlement, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 entitlement specified in the request. Updated fields in the - # entitlement need to be specified in an update mask. The changes made to an - # entitlement are applicable only on future grants of the entitlement. - # However, if new approvers are added or existing approvers are removed from - # the approval workflow, the changes are effective on existing grants. - # - # The following fields are not supported for updates: - # - # * All immutable fields - # * Entitlement name - # * Resource name - # * Resource type - # * Adding an approval workflow in an entitlement which previously had no - # approval workflow. - # * Deleting the approval workflow from an entitlement. - # * Adding or deleting a step in the approval workflow (only one step is - # supported) - # - # Note that updates are allowed on the list of approvers in an approval - # workflow step. - # - # @overload update_entitlement(request, options = nil) - # Pass arguments to `update_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_entitlement(entitlement: nil, update_mask: nil) - # Pass arguments to `update_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::Hash] - # Required. The entitlement resource that is updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. A field is overwritten if, and only - # if, it is in the mask. Any immutable fields set in the mask are ignored by - # the server. Repeated fields and map fields are only allowed in the last - # position of a `paths` string and overwrite the existing values. Hence an - # update to a repeated field or a map should contain the entire list of - # values. The fields specified in the update_mask are relative to the - # resource and not to the request. - # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - # A value of '*' for this field refers to full replacement of the 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/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new - # - # # Call the update_entitlement method. - # result = client.update_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest - - # Converts hash and nil to 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_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.entitlement&.name - header_params["entitlement.name"] = request.entitlement.name - end - - request_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_entitlement.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :update_entitlement, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 grants for a given entitlement. - # - # @overload list_grants(request, options = nil) - # Pass arguments to `list_grants` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_grants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_grants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource which owns the grants. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results. - # @param order_by [::String] - # Optional. Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new - # - # # Call the list_grants method. - # result = client.list_grants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p item - # end - # - def list_grants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_grants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_grants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_grants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :list_grants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :list_grants, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `SearchGrants` returns grants that are related to the calling user in the - # specified way. - # - # @overload search_grants(request, options = nil) - # Pass arguments to `search_grants` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_grants(parent: nil, caller_relationship: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_grants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the grant resources. - # @param caller_relationship [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] - # Required. Only grants which the caller is related to by this relationship - # are returned in the response. - # @param filter [::String] - # Optional. Only grants matching this filter are returned in the response. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, server picks 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::PrivilegedAccessManager::V1::Grant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new - # - # # Call the search_grants method. - # result = client.search_grants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p item - # end - # - def search_grants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest - - # Converts hash and nil to 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_grants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_grants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_grants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :search_grants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get details of a single grant. - # - # @overload get_grant(request, options = nil) - # Pass arguments to `get_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_grant(name: nil) - # Pass arguments to `get_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new - # - # # Call the get_grant method. - # result = client.get_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def get_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_grant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :get_grant, request, 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 grant in a given project/folder/organization and - # location. - # - # @overload create_grant(request, options = nil) - # Pass arguments to `create_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_grant(parent: nil, grant: nil, request_id: nil) - # Pass arguments to `create_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent entitlement for which this grant is being - # requested. - # @param grant [::Google::Cloud::PrivilegedAccessManager::V1::Grant, ::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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. This prevents - # clients from accidentally creating duplicate grants. - # - # 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::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new - # - # # Call the create_grant method. - # result = client.create_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def create_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest - - # Converts hash and nil to 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_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_grant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :create_grant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `ApproveGrant` is used to approve a grant. This method can only be called - # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't - # be undone. - # - # @overload approve_grant(request, options = nil) - # Pass arguments to `approve_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload approve_grant(name: nil, reason: nil) - # Pass arguments to `approve_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being approved. - # @param reason [::String] - # Optional. The reason for approving this grant. This is required if the - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new - # - # # Call the approve_grant method. - # result = client.approve_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def approve_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.approve_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.approve_grant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.approve_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :approve_grant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `DenyGrant` is used to deny a grant. This method can only be called on a - # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be - # undone. - # - # @overload deny_grant(request, options = nil) - # Pass arguments to `deny_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deny_grant(name: nil, reason: nil) - # Pass arguments to `deny_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being denied. - # @param reason [::String] - # Optional. The reason for denying this grant. This is required if - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new - # - # # Call the deny_grant method. - # result = client.deny_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def deny_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.deny_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.deny_grant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deny_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :deny_grant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `RevokeGrant` is used to immediately revoke access for a grant. This method - # can be called when the grant is in a non-terminal state. - # - # @overload revoke_grant(request, options = nil) - # Pass arguments to `revoke_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_grant(name: nil, reason: nil) - # Pass arguments to `revoke_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being revoked. - # @param reason [::String] - # Optional. The reason for revoking this grant. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new - # - # # Call the revoke_grant method. - # result = client.revoke_grant request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def revoke_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest - - # Converts hash and nil to 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_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_grant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.revoke_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.call_rpc :revoke_grant, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 PrivilegedAccessManager API. - # - # This class represents the configuration for PrivilegedAccessManager, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # check_onboarding_status to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.check_onboarding_status.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.check_onboarding_status.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 = "privilegedaccessmanager.googleapis.com" - - config_attr :endpoint, nil, ::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 PrivilegedAccessManager API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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 `check_onboarding_status` - # @return [::Gapic::Config::Method] - # - attr_reader :check_onboarding_status - ## - # RPC-specific configuration for `list_entitlements` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entitlements - ## - # RPC-specific configuration for `search_entitlements` - # @return [::Gapic::Config::Method] - # - attr_reader :search_entitlements - ## - # RPC-specific configuration for `get_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :get_entitlement - ## - # RPC-specific configuration for `create_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :create_entitlement - ## - # RPC-specific configuration for `delete_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_entitlement - ## - # RPC-specific configuration for `update_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :update_entitlement - ## - # RPC-specific configuration for `list_grants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_grants - ## - # RPC-specific configuration for `search_grants` - # @return [::Gapic::Config::Method] - # - attr_reader :search_grants - ## - # RPC-specific configuration for `get_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_grant - ## - # RPC-specific configuration for `create_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_grant - ## - # RPC-specific configuration for `approve_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_grant - ## - # RPC-specific configuration for `deny_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :deny_grant - ## - # RPC-specific configuration for `revoke_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_grant - - # @private - def initialize parent_rpcs = nil - check_onboarding_status_config = parent_rpcs.check_onboarding_status if parent_rpcs.respond_to? :check_onboarding_status - @check_onboarding_status = ::Gapic::Config::Method.new check_onboarding_status_config - list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements - @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config - search_entitlements_config = parent_rpcs.search_entitlements if parent_rpcs.respond_to? :search_entitlements - @search_entitlements = ::Gapic::Config::Method.new search_entitlements_config - get_entitlement_config = parent_rpcs.get_entitlement if parent_rpcs.respond_to? :get_entitlement - @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config - create_entitlement_config = parent_rpcs.create_entitlement if parent_rpcs.respond_to? :create_entitlement - @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config - delete_entitlement_config = parent_rpcs.delete_entitlement if parent_rpcs.respond_to? :delete_entitlement - @delete_entitlement = ::Gapic::Config::Method.new delete_entitlement_config - update_entitlement_config = parent_rpcs.update_entitlement if parent_rpcs.respond_to? :update_entitlement - @update_entitlement = ::Gapic::Config::Method.new update_entitlement_config - list_grants_config = parent_rpcs.list_grants if parent_rpcs.respond_to? :list_grants - @list_grants = ::Gapic::Config::Method.new list_grants_config - search_grants_config = parent_rpcs.search_grants if parent_rpcs.respond_to? :search_grants - @search_grants = ::Gapic::Config::Method.new search_grants_config - get_grant_config = parent_rpcs.get_grant if parent_rpcs.respond_to? :get_grant - @get_grant = ::Gapic::Config::Method.new get_grant_config - create_grant_config = parent_rpcs.create_grant if parent_rpcs.respond_to? :create_grant - @create_grant = ::Gapic::Config::Method.new create_grant_config - approve_grant_config = parent_rpcs.approve_grant if parent_rpcs.respond_to? :approve_grant - @approve_grant = ::Gapic::Config::Method.new approve_grant_config - deny_grant_config = parent_rpcs.deny_grant if parent_rpcs.respond_to? :deny_grant - @deny_grant = ::Gapic::Config::Method.new deny_grant_config - revoke_grant_config = parent_rpcs.revoke_grant if parent_rpcs.respond_to? :revoke_grant - @revoke_grant = ::Gapic::Config::Method.new revoke_grant_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials.rb deleted file mode 100644 index 368e8ad07437..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_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 PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - # Credentials for the PrivilegedAccessManager 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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/operations.rb deleted file mode 100644 index 9ac844f19b02..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_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 PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PrivilegedAccessManager 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 PrivilegedAccessManager 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::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::PrivilegedAccessManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::PrivilegedAccessManager::V1::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 = "privilegedaccessmanager.googleapis.com" - - config_attr :endpoint, nil, ::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-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb deleted file mode 100644 index db3cf0bd41c5..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/paths.rb +++ /dev/null @@ -1,206 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - # Path helper methods for the PrivilegedAccessManager API. - module Paths - ## - # Create a fully-qualified Entitlement resource string. - # - # @overload entitlement_path(project:, location:, entitlement:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/entitlements/{entitlement}` - # - # @param project [String] - # @param location [String] - # @param entitlement [String] - # - # @overload entitlement_path(folder:, location:, entitlement:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/entitlements/{entitlement}` - # - # @param folder [String] - # @param location [String] - # @param entitlement [String] - # - # @overload entitlement_path(organization:, location:, entitlement:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/entitlements/{entitlement}` - # - # @param organization [String] - # @param location [String] - # @param entitlement [String] - # - # @return [::String] - def entitlement_path **args - resources = { - "entitlement:location:project" => (proc do |project:, location:, entitlement:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/entitlements/#{entitlement}" - end), - "entitlement:folder:location" => (proc do |folder:, location:, entitlement:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/entitlements/#{entitlement}" - end), - "entitlement:location:organization" => (proc do |organization:, location:, entitlement:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/entitlements/#{entitlement}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified FolderLocation resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}` - # - # @param folder [String] - # @param location [String] - # - # @return [::String] - def folder_location_path folder:, location: - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/locations/#{location}" - end - - ## - # Create a fully-qualified Grant resource string. - # - # @overload grant_path(project:, location:, entitlement:, grant:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}` - # - # @param project [String] - # @param location [String] - # @param entitlement [String] - # @param grant [String] - # - # @overload grant_path(folder:, location:, entitlement:, grant:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}` - # - # @param folder [String] - # @param location [String] - # @param entitlement [String] - # @param grant [String] - # - # @overload grant_path(organization:, location:, entitlement:, grant:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}` - # - # @param organization [String] - # @param location [String] - # @param entitlement [String] - # @param grant [String] - # - # @return [::String] - def grant_path **args - resources = { - "entitlement:grant:location:project" => (proc do |project:, location:, entitlement:, grant:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" - - "projects/#{project}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" - end), - "entitlement:folder:grant:location" => (proc do |folder:, location:, entitlement:, grant:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" - end), - "entitlement:grant:location:organization" => (proc do |organization:, location:, entitlement:, grant:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "entitlement cannot contain /" if entitlement.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/entitlements/#{entitlement}/grants/#{grant}" - 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 Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified OrganizationLocation resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}` - # - # @param organization [String] - # @param location [String] - # - # @return [::String] - def organization_location_path organization:, location: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.rb deleted file mode 100644 index 21d09415b196..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/privileged_access_manager/v1/version" -require "google/cloud/privileged_access_manager/v1/bindings_override" - -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/credentials" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/paths" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client" - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - ## - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - module PrivilegedAccessManager - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb deleted file mode 100644 index 86d01e30524b..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/client.rb +++ /dev/null @@ -1,1807 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - module Rest - ## - # REST client for the PrivilegedAccessManager service. - # - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :privileged_access_manager_stub - - ## - # Configure the PrivilegedAccessManager Client class. - # - # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrivilegedAccessManager clients - # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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", "PrivilegedAccessManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrivilegedAccessManager Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - @privileged_access_manager_stub.universe_domain - end - - ## - # Create a new PrivilegedAccessManager REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrivilegedAccessManager 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - - @privileged_access_manager_stub = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @privileged_access_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 = @privileged_access_manager_stub.endpoint - config.universe_domain = @privileged_access_manager_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @privileged_access_manager_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - @privileged_access_manager_stub.logger - end - - # Service calls - - ## - # `CheckOnboardingStatus` reports the onboarding status for a - # project/folder/organization. Any findings reported by this API need to be - # fixed before PAM can be used on the resource. - # - # @overload check_onboarding_status(request, options = nil) - # Pass arguments to `check_onboarding_status` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload check_onboarding_status(parent: nil) - # Pass arguments to `check_onboarding_status` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource for which the onboarding status should be checked. - # Should be in one of the following formats: - # - # * `projects/{project-number|project-id}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `organizations/{organization-number}/locations/{region}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new - # - # # Call the check_onboarding_status method. - # result = client.check_onboarding_status request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. - # p result - # - def check_onboarding_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.check_onboarding_status.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.check_onboarding_status.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.check_onboarding_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.check_onboarding_status request, 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 entitlements in a given project/folder/organization and location. - # - # @overload list_entitlements(request, options = nil) - # Pass arguments to `list_entitlements` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_entitlements` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the entitlement resources. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results. - # @param order_by [::String] - # Optional. 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::PrivilegedAccessManager::V1::Entitlement>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new - # - # # Call the list_entitlements method. - # result = client.list_entitlements request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p item - # end - # - def list_entitlements request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_entitlements.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_entitlements.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.list_entitlements request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :list_entitlements, "entitlements", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `SearchEntitlements` returns entitlements on which the caller has the - # specified access. - # - # @overload search_entitlements(request, options = nil) - # Pass arguments to `search_entitlements` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entitlements(parent: nil, caller_access_type: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_entitlements` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the entitlement resources. - # @param caller_access_type [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] - # Required. Only entitlements where the calling user has this access are - # returned. - # @param filter [::String] - # Optional. Only entitlements matching this filter are returned in the - # response. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks 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::PrivilegedAccessManager::V1::Entitlement>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new - # - # # Call the search_entitlements method. - # result = client.search_entitlements request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p item - # end - # - def search_entitlements request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest - - # Converts hash and nil to an 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_entitlements.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entitlements.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_entitlements.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.search_entitlements request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_entitlements, "entitlements", request, result, 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 entitlement. - # - # @overload get_entitlement(request, options = nil) - # Pass arguments to `get_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_entitlement(name: nil) - # Pass arguments to `get_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Entitlement] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new - # - # # Call the get_entitlement method. - # result = client.get_entitlement request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - # p result - # - def get_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.get_entitlement request, 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 entitlement in a given project/folder/organization and - # location. - # - # @overload create_entitlement(request, options = nil) - # Pass arguments to `create_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_entitlement(parent: nil, entitlement_id: nil, entitlement: nil, request_id: nil) - # Pass arguments to `create_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent resource for the entitlement. - # Possible formats: - # - # * `organizations/{organization-number}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `projects/{project-id|project-number}/locations/{region}` - # @param entitlement_id [::String] - # Required. The ID to use for this entitlement. This becomes the last part of - # the resource name. - # - # This value should be 4-63 characters in length, and valid characters are - # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - # - # This value should be unique among all other entitlements under the - # specified `parent`. - # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request and returns the - # previous operation's response. This prevents clients from accidentally - # creating duplicate entitlements. - # - # 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/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new - # - # # Call the create_entitlement method. - # result = client.create_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest - - # Converts hash and nil to an 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_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.create_entitlement request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 entitlement. This method can only be called when there - # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the - # entitlement. - # - # @overload delete_entitlement(request, options = nil) - # Pass arguments to `delete_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_entitlement(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, any child grant under this entitlement is also - # deleted. (Otherwise, the request only works if the entitlement has no child - # grant.) - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new - # - # # Call the delete_entitlement method. - # result = client.delete_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest - - # Converts hash and nil to an 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_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.delete_entitlement request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 entitlement specified in the request. Updated fields in the - # entitlement need to be specified in an update mask. The changes made to an - # entitlement are applicable only on future grants of the entitlement. - # However, if new approvers are added or existing approvers are removed from - # the approval workflow, the changes are effective on existing grants. - # - # The following fields are not supported for updates: - # - # * All immutable fields - # * Entitlement name - # * Resource name - # * Resource type - # * Adding an approval workflow in an entitlement which previously had no - # approval workflow. - # * Deleting the approval workflow from an entitlement. - # * Adding or deleting a step in the approval workflow (only one step is - # supported) - # - # Note that updates are allowed on the list of approvers in an approval - # workflow step. - # - # @overload update_entitlement(request, options = nil) - # Pass arguments to `update_entitlement` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_entitlement(entitlement: nil, update_mask: nil) - # Pass arguments to `update_entitlement` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param entitlement [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement, ::Hash] - # Required. The entitlement resource that is updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. A field is overwritten if, and only - # if, it is in the mask. Any immutable fields set in the mask are ignored by - # the server. Repeated fields and map fields are only allowed in the last - # position of a `paths` string and overwrite the existing values. Hence an - # update to a repeated field or a map should contain the entire list of - # values. The fields specified in the update_mask are relative to the - # resource and not to the request. - # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - # A value of '*' for this field refers to full replacement of the 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/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new - # - # # Call the update_entitlement method. - # result = client.update_entitlement request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_entitlement request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest - - # Converts hash and nil to an 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_entitlement.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entitlement.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_entitlement.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.update_entitlement request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 grants for a given entitlement. - # - # @overload list_grants(request, options = nil) - # Pass arguments to `list_grants` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_grants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_grants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource which owns the grants. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results. - # @param order_by [::String] - # Optional. 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::PrivilegedAccessManager::V1::Grant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new - # - # # Call the list_grants method. - # result = client.list_grants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p item - # end - # - def list_grants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_grants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_grants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_grants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.list_grants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :list_grants, "grants", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `SearchGrants` returns grants that are related to the calling user in the - # specified way. - # - # @overload search_grants(request, options = nil) - # Pass arguments to `search_grants` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_grants(parent: nil, caller_relationship: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_grants` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent which owns the grant resources. - # @param caller_relationship [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] - # Required. Only grants which the caller is related to by this relationship - # are returned in the response. - # @param filter [::String] - # Optional. Only grants matching this filter are returned in the response. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, server picks 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::PrivilegedAccessManager::V1::Grant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new - # - # # Call the search_grants method. - # result = client.search_grants request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p item - # end - # - def search_grants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest - - # Converts hash and nil to an 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_grants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_grants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_grants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.search_grants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @privileged_access_manager_stub, :search_grants, "grants", request, result, 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 details of a single grant. - # - # @overload get_grant(request, options = nil) - # Pass arguments to `get_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_grant(name: nil) - # Pass arguments to `get_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new - # - # # Call the get_grant method. - # result = client.get_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def get_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_grant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.get_grant request, 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 grant in a given project/folder/organization and - # location. - # - # @overload create_grant(request, options = nil) - # Pass arguments to `create_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_grant(parent: nil, grant: nil, request_id: nil) - # Pass arguments to `create_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent entitlement for which this grant is being - # requested. - # @param grant [::Google::Cloud::PrivilegedAccessManager::V1::Grant, ::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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. This prevents - # clients from accidentally creating duplicate grants. - # - # 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::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new - # - # # Call the create_grant method. - # result = client.create_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def create_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest - - # Converts hash and nil to an 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_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_grant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.create_grant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `ApproveGrant` is used to approve a grant. This method can only be called - # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't - # be undone. - # - # @overload approve_grant(request, options = nil) - # Pass arguments to `approve_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload approve_grant(name: nil, reason: nil) - # Pass arguments to `approve_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being approved. - # @param reason [::String] - # Optional. The reason for approving this grant. This is required if the - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new - # - # # Call the approve_grant method. - # result = client.approve_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def approve_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.approve_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.approve_grant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.approve_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.approve_grant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `DenyGrant` is used to deny a grant. This method can only be called on a - # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be - # undone. - # - # @overload deny_grant(request, options = nil) - # Pass arguments to `deny_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload deny_grant(name: nil, reason: nil) - # Pass arguments to `deny_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being denied. - # @param reason [::String] - # Optional. The reason for denying this grant. This is required if - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new - # - # # Call the deny_grant method. - # result = client.deny_grant request - # - # # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - # p result - # - def deny_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.deny_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.deny_grant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deny_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.deny_grant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # `RevokeGrant` is used to immediately revoke access for a grant. This method - # can be called when the grant is in a non-terminal state. - # - # @overload revoke_grant(request, options = nil) - # Pass arguments to `revoke_grant` via a request object, either of type - # {::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_grant(name: nil, reason: nil) - # Pass arguments to `revoke_grant` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 grant resource which is being revoked. - # @param reason [::String] - # Optional. The reason for revoking this grant. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/privileged_access_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new - # - # # Call the revoke_grant method. - # result = client.revoke_grant request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def revoke_grant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest - - # Converts hash and nil to an 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_grant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_grant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.revoke_grant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @privileged_access_manager_stub.revoke_grant request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 PrivilegedAccessManager REST API. - # - # This class represents the configuration for PrivilegedAccessManager 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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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 - # # check_onboarding_status to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.check_onboarding_status.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.check_onboarding_status.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "privilegedaccessmanager.googleapis.com" - - config_attr :endpoint, nil, ::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 PrivilegedAccessManager API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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 `check_onboarding_status` - # @return [::Gapic::Config::Method] - # - attr_reader :check_onboarding_status - ## - # RPC-specific configuration for `list_entitlements` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entitlements - ## - # RPC-specific configuration for `search_entitlements` - # @return [::Gapic::Config::Method] - # - attr_reader :search_entitlements - ## - # RPC-specific configuration for `get_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :get_entitlement - ## - # RPC-specific configuration for `create_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :create_entitlement - ## - # RPC-specific configuration for `delete_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_entitlement - ## - # RPC-specific configuration for `update_entitlement` - # @return [::Gapic::Config::Method] - # - attr_reader :update_entitlement - ## - # RPC-specific configuration for `list_grants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_grants - ## - # RPC-specific configuration for `search_grants` - # @return [::Gapic::Config::Method] - # - attr_reader :search_grants - ## - # RPC-specific configuration for `get_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_grant - ## - # RPC-specific configuration for `create_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_grant - ## - # RPC-specific configuration for `approve_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_grant - ## - # RPC-specific configuration for `deny_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :deny_grant - ## - # RPC-specific configuration for `revoke_grant` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_grant - - # @private - def initialize parent_rpcs = nil - check_onboarding_status_config = parent_rpcs.check_onboarding_status if parent_rpcs.respond_to? :check_onboarding_status - @check_onboarding_status = ::Gapic::Config::Method.new check_onboarding_status_config - list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements - @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config - search_entitlements_config = parent_rpcs.search_entitlements if parent_rpcs.respond_to? :search_entitlements - @search_entitlements = ::Gapic::Config::Method.new search_entitlements_config - get_entitlement_config = parent_rpcs.get_entitlement if parent_rpcs.respond_to? :get_entitlement - @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config - create_entitlement_config = parent_rpcs.create_entitlement if parent_rpcs.respond_to? :create_entitlement - @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config - delete_entitlement_config = parent_rpcs.delete_entitlement if parent_rpcs.respond_to? :delete_entitlement - @delete_entitlement = ::Gapic::Config::Method.new delete_entitlement_config - update_entitlement_config = parent_rpcs.update_entitlement if parent_rpcs.respond_to? :update_entitlement - @update_entitlement = ::Gapic::Config::Method.new update_entitlement_config - list_grants_config = parent_rpcs.list_grants if parent_rpcs.respond_to? :list_grants - @list_grants = ::Gapic::Config::Method.new list_grants_config - search_grants_config = parent_rpcs.search_grants if parent_rpcs.respond_to? :search_grants - @search_grants = ::Gapic::Config::Method.new search_grants_config - get_grant_config = parent_rpcs.get_grant if parent_rpcs.respond_to? :get_grant - @get_grant = ::Gapic::Config::Method.new get_grant_config - create_grant_config = parent_rpcs.create_grant if parent_rpcs.respond_to? :create_grant - @create_grant = ::Gapic::Config::Method.new create_grant_config - approve_grant_config = parent_rpcs.approve_grant if parent_rpcs.respond_to? :approve_grant - @approve_grant = ::Gapic::Config::Method.new approve_grant_config - deny_grant_config = parent_rpcs.deny_grant if parent_rpcs.respond_to? :deny_grant - @deny_grant = ::Gapic::Config::Method.new deny_grant_config - revoke_grant_config = parent_rpcs.revoke_grant if parent_rpcs.respond_to? :revoke_grant - @revoke_grant = ::Gapic::Config::Method.new revoke_grant_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb deleted file mode 100644 index 89aebd7b524e..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/operations.rb +++ /dev/null @@ -1,967 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "privilegedaccessmanager.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PrivilegedAccessManager 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 PrivilegedAccessManager 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::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::PrivilegedAccessManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "privilegedaccessmanager.googleapis.com" - - config_attr :endpoint, nil, ::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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^folders/[^/]+/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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/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] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/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{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb deleted file mode 100644 index 4bc26c522b26..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/privileged_access_manager/rest/service_stub.rb +++ /dev/null @@ -1,1149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - module Rest - ## - # REST service stub for the PrivilegedAccessManager 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 check_onboarding_status REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse] - # A result object deserialized from the server's reply - def check_onboarding_status request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_check_onboarding_status_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "check_onboarding_status", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.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_entitlements REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse] - # A result object deserialized from the server's reply - def list_entitlements request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_entitlements_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_entitlements", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.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_entitlements REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse] - # A result object deserialized from the server's reply - def search_entitlements request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_entitlements_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entitlements", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # A result object deserialized from the server's reply - def get_entitlement request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_entitlement_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_entitlement", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.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_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_entitlement request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_entitlement_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entitlement", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_entitlement request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_entitlement_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entitlement", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_entitlement request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_entitlement_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entitlement", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_grants REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse] - # A result object deserialized from the server's reply - def list_grants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_grants_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_grants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.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_grants REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse] - # A result object deserialized from the server's reply - def search_grants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_grants_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_grants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # A result object deserialized from the server's reply - def get_grant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_grant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_grant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.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_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # A result object deserialized from the server's reply - def create_grant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_grant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_grant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the approve_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # A result object deserialized from the server's reply - def approve_grant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_approve_grant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "approve_grant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the deny_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # A result object deserialized from the server's reply - def deny_grant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deny_grant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "deny_grant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.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_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def revoke_grant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_revoke_grant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_grant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 check_onboarding_status REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_check_onboarding_status_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:checkOnboardingStatus", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:checkOnboardingStatus", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:checkOnboardingStatus", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_entitlements REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_entitlements_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_entitlements REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest] - # 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_entitlements_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements:search", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements:search", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/entitlements:search", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_entitlement_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest] - # 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_entitlement_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/entitlements", - body: "entitlement", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/entitlements", - body: "entitlement", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/entitlements", - body: "entitlement", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest] - # 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_entitlement_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_entitlement REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest] - # 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_entitlement_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{entitlement.name}", - body: "entitlement", - matches: [ - ["entitlement.name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{entitlement.name}", - body: "entitlement", - matches: [ - ["entitlement.name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{entitlement.name}", - body: "entitlement", - matches: [ - ["entitlement.name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_grants REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_grants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_grants REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest] - # 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_grants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants:search", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants:search", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/grants:search", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_grant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest] - # 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_grant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/grants", - body: "grant", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/grants", - body: "grant", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/grants", - body: "grant", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the approve_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_approve_grant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:approve", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:approve", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:approve", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deny_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deny_grant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deny", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deny", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deny", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the revoke_grant REST call - # - # @param request_pb [::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest] - # 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_grant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/entitlements/[^/]+/grants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/rest.rb deleted file mode 100644 index 0bf38c0312fb..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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/privileged_access_manager/v1/privileged_access_manager/rest" -require "google/cloud/privileged_access_manager/v1/bindings_override" -require "google/cloud/privileged_access_manager/v1/version" - -module Google - module Cloud - module PrivilegedAccessManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/privileged_access_manager/v1/rest" - # client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_manager/v1/version.rb deleted file mode 100644 index 967f84a73478..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privileged_access_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 PrivilegedAccessManager - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb deleted file mode 100644 index a05367d9f2af..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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/rpc/status_pb' - - -descriptor_data = "\nEgoogle/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto\x12\'google.cloud.privilegedaccessmanager.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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"j\n\x1c\x43heckOnboardingStatusRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\"\xe3\x02\n\x1d\x43heckOnboardingStatusResponse\x12\x17\n\x0fservice_account\x18\x01 \x01(\t\x12`\n\x08\x66indings\x18\x02 \x03(\x0b\x32N.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding\x1a\xc6\x01\n\x07\x46inding\x12{\n\x11iam_access_denied\x18\x01 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDeniedH\x00\x1a.\n\x0fIAMAccessDenied\x12\x1b\n\x13missing_permissions\x18\x01 \x03(\tB\x0e\n\x0c\x66inding_type\"\xfd\x0c\n\x0b\x45ntitlement\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12X\n\x0e\x65ligible_users\x18\x05 \x03(\x0b\x32;.google.cloud.privilegedaccessmanager.v1.AccessControlEntryB\x03\xe0\x41\x01\x12Y\n\x11\x61pproval_workflow\x18\x06 \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.ApprovalWorkflowB\x03\xe0\x41\x01\x12T\n\x11privileged_access\x18\x07 \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess\x12<\n\x14max_request_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12N\n\x05state\x18\t \x01(\x0e\x32:.google.cloud.privilegedaccessmanager.v1.Entitlement.StateB\x03\xe0\x41\x03\x12~\n\x1erequester_justification_config\x18\n \x01(\x0b\x32Q.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfigB\x03\xe0\x41\x02\x12\x80\x01\n\x1f\x61\x64\x64itional_notification_targets\x18\x0b \x01(\x0b\x32R.google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargetsB\x03\xe0\x41\x01\x12\x0c\n\x04\x65tag\x18\x0c \x01(\t\x1a\xc5\x02\n\x1cRequesterJustificationConfig\x12w\n\rnot_mandatory\x18\x01 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatoryH\x00\x12v\n\x0cunstructured\x18\x02 \x01(\x0b\x32^.google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.UnstructuredH\x00\x1a\x0e\n\x0cNotMandatory\x1a\x0e\n\x0cUnstructuredB\x14\n\x12justification_type\x1am\n\x1d\x41\x64\x64itionalNotificationTargets\x12#\n\x16\x61\x64min_email_recipients\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\'\n\x1arequester_email_recipients\x18\x02 \x03(\tB\x03\xe0\x41\x01\"d\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\r\n\tAVAILABLE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0b\n\x07\x44\x45LETED\x10\x04\x12\x0c\n\x08UPDATING\x10\x05:\xa7\x02\xea\x41\xa3\x02\n2privilegedaccessmanager.googleapis.com/Entitlement\x12\x42projects/{project}/locations/{location}/entitlements/{entitlement}\x12@folders/{folder}/locations/{location}/entitlements/{entitlement}\x12Lorganizations/{organization}/locations/{location}/entitlements/{entitlement}*\x0c\x65ntitlements2\x0b\x65ntitlement\"-\n\x12\x41\x63\x63\x65ssControlEntry\x12\x17\n\nprincipals\x18\x01 \x03(\tB\x03\xe0\x41\x01\"}\n\x10\x41pprovalWorkflow\x12T\n\x10manual_approvals\x18\x01 \x01(\x0b\x32\x38.google.cloud.privilegedaccessmanager.v1.ManualApprovalsH\x00\x42\x13\n\x11\x61pproval_workflow\"\xb6\x02\n\x0fManualApprovals\x12+\n\x1erequire_approver_justification\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12Q\n\x05steps\x18\x02 \x03(\x0b\x32=.google.cloud.privilegedaccessmanager.v1.ManualApprovals.StepB\x03\xe0\x41\x01\x1a\xa2\x01\n\x04Step\x12S\n\tapprovers\x18\x01 \x03(\x0b\x32;.google.cloud.privilegedaccessmanager.v1.AccessControlEntryB\x03\xe0\x41\x01\x12\x1d\n\x10\x61pprovals_needed\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12&\n\x19\x61pprover_email_recipients\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\xfc\x02\n\x10PrivilegedAccess\x12`\n\x0egcp_iam_access\x18\x01 \x01(\x0b\x32\x46.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccessH\x00\x1a\xf6\x01\n\x0cGcpIamAccess\x12\x1a\n\rresource_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08resource\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12n\n\rrole_bindings\x18\x04 \x03(\x0b\x32R.google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBindingB\x03\xe0\x41\x02\x1a\x43\n\x0bRoleBinding\x12\x11\n\x04role\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14\x63ondition_expression\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x61\x63\x63\x65ss_type\"\xc2\x01\n\x17ListEntitlementsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x94\x01\n\x18ListEntitlementsResponse\x12J\n\x0c\x65ntitlements\x18\x01 \x03(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x84\x03\n\x19SearchEntitlementsRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12t\n\x12\x63\x61ller_access_type\x18\x02 \x01(\x0e\x32S.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessTypeB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\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\"_\n\x10\x43\x61llerAccessType\x12\"\n\x1e\x43\x41LLER_ACCESS_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fGRANT_REQUESTER\x10\x01\x12\x12\n\x0eGRANT_APPROVER\x10\x02\"\x81\x01\n\x1aSearchEntitlementsResponse\x12J\n\x0c\x65ntitlements\x18\x01 \x03(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x15GetEntitlementRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privilegedaccessmanager.googleapis.com/Entitlement\"\xec\x01\n\x18\x43reateEntitlementRequest\x12J\n\x06parent\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\x12\x32privilegedaccessmanager.googleapis.com/Entitlement\x12\x1b\n\x0e\x65ntitlement_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x0b\x65ntitlement\x18\x03 \x01(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.EntitlementB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x18\x44\x65leteEntitlementRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2privilegedaccessmanager.googleapis.com/Entitlement\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xa0\x01\n\x18UpdateEntitlementRequest\x12N\n\x0b\x65ntitlement\x18\x01 \x01(\x0b\x32\x34.google.cloud.privilegedaccessmanager.v1.EntitlementB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xd6\x17\n\x05Grant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x16\n\trequester\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12:\n\x12requested_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12R\n\rjustification\x18\x06 \x01(\x0b\x32\x36.google.cloud.privilegedaccessmanager.v1.JustificationB\x03\xe0\x41\x01\x12H\n\x05state\x18\x07 \x01(\x0e\x32\x34.google.cloud.privilegedaccessmanager.v1.Grant.StateB\x03\xe0\x41\x03\x12N\n\x08timeline\x18\x08 \x01(\x0b\x32\x37.google.cloud.privilegedaccessmanager.v1.Grant.TimelineB\x03\xe0\x41\x03\x12Y\n\x11privileged_access\x18\t \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.PrivilegedAccessB\x03\xe0\x41\x03\x12S\n\x0b\x61udit_trail\x18\n \x01(\x0b\x32\x39.google.cloud.privilegedaccessmanager.v1.Grant.AuditTrailB\x03\xe0\x41\x03\x12(\n\x1b\x61\x64\x64itional_email_recipients\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12 \n\x13\x65xternally_modified\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03\x1a\xea\x0c\n\x08Timeline\x12R\n\x06\x65vents\x18\x01 \x03(\x0b\x32=.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.EventB\x03\xe0\x41\x03\x1a\x89\x0c\n\x05\x45vent\x12\\\n\trequested\x18\x02 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.RequestedH\x00\x12Z\n\x08\x61pproved\x18\x03 \x01(\x0b\x32\x46.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ApprovedH\x00\x12V\n\x06\x64\x65nied\x18\x04 \x01(\x0b\x32\x44.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.DeniedH\x00\x12X\n\x07revoked\x18\x05 \x01(\x0b\x32\x45.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.RevokedH\x00\x12\\\n\tscheduled\x18\x06 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ScheduledH\x00\x12\\\n\tactivated\x18\x07 \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivatedH\x00\x12k\n\x11\x61\x63tivation_failed\x18\x08 \x01(\x0b\x32N.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailedH\x00\x12X\n\x07\x65xpired\x18\n \x01(\x0b\x32\x45.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExpiredH\x00\x12T\n\x05\x65nded\x18\x0b \x01(\x0b\x32\x43.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.EndedH\x00\x12o\n\x13\x65xternally_modified\x18\x0c \x01(\x0b\x32P.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModifiedH\x00\x12\\\n\twithdrawn\x18\r \x01(\x0b\x32G.google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.WithdrawnH\x00\x12\x33\n\nevent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\tRequested\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x33\n\x08\x41pproved\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x31\n\x06\x44\x65nied\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x07Revoked\x12\x13\n\x06reason\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x61\x63tor\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x0b\n\tWithdrawn\x1aO\n\tScheduled\x12\x42\n\x19scheduled_activation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x0b\n\tActivated\x1a:\n\x10\x41\x63tivationFailed\x12&\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\t\n\x07\x45xpired\x1a\x07\n\x05\x45nded\x1a\x14\n\x12\x45xternallyModifiedB\x07\n\x05\x65vent\x1a\x85\x01\n\nAuditTrail\x12:\n\x11\x61\x63\x63\x65ss_grant_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x12\x61\x63\x63\x65ss_remove_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xd5\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41PPROVAL_AWAITED\x10\x01\x12\n\n\x06\x44\x45NIED\x10\x03\x12\r\n\tSCHEDULED\x10\x04\x12\x0e\n\nACTIVATING\x10\x05\x12\n\n\x06\x41\x43TIVE\x10\x06\x12\x15\n\x11\x41\x43TIVATION_FAILED\x10\x07\x12\x0b\n\x07\x45XPIRED\x10\x08\x12\x0c\n\x08REVOKING\x10\t\x12\x0b\n\x07REVOKED\x10\n\x12\t\n\x05\x45NDED\x10\x0b\x12\x0f\n\x0bWITHDRAWING\x10\x0c\x12\r\n\tWITHDRAWN\x10\r:\xc2\x02\xea\x41\xbe\x02\n,privilegedaccessmanager.googleapis.com/Grant\x12Qprojects/{project}/locations/{location}/entitlements/{entitlement}/grants/{grant}\x12Ofolders/{folder}/locations/{location}/entitlements/{entitlement}/grants/{grant}\x12[organizations/{organization}/locations/{location}/entitlements/{entitlement}/grants/{grant}*\x06grants2\x05grant\"F\n\rJustification\x12$\n\x1aunstructured_justification\x18\x01 \x01(\tH\x00\x42\x0f\n\rjustification\"\xb6\x01\n\x11ListGrantsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\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\"\x82\x01\n\x12ListGrantsResponse\x12>\n\x06grants\x18\x01 \x03(\x0b\x32..google.cloud.privilegedaccessmanager.v1.Grant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x90\x03\n\x13SearchGrantsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\x12u\n\x13\x63\x61ller_relationship\x18\x02 \x01(\x0e\x32S.google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipTypeB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\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\"v\n\x16\x43\x61llerRelationshipType\x12(\n$CALLER_RELATIONSHIP_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHAD_CREATED\x10\x01\x12\x0f\n\x0b\x43\x41N_APPROVE\x10\x02\x12\x10\n\x0cHAD_APPROVED\x10\x03\"o\n\x14SearchGrantsResponse\x12>\n\x06grants\x18\x01 \x03(\x0b\x32..google.cloud.privilegedaccessmanager.v1.Grant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"U\n\x0fGetGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\"n\n\x13\x41pproveGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"k\n\x10\x44\x65nyGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"m\n\x12RevokeGrantRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,privilegedaccessmanager.googleapis.com/Grant\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n\x12\x43reateGrantRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,privilegedaccessmanager.googleapis.com/Grant\x12\x42\n\x05grant\x18\x02 \x01(\x0b\x32..google.cloud.privilegedaccessmanager.v1.GrantB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \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\x32\xc1\'\n\x17PrivilegedAccessManager\x12\xe9\x02\n\x15\x43heckOnboardingStatus\x12\x45.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest\x1a\x46.google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse\"\xc0\x01\x82\xd3\xe4\x93\x02\xb9\x01\x12\x39/v1/{parent=projects/*/locations/*}:checkOnboardingStatusZ@\x12>/v1/{parent=organizations/*/locations/*}:checkOnboardingStatusZ:\x12\x38/v1/{parent=folders/*/locations/*}:checkOnboardingStatus\x12\xc8\x02\n\x10ListEntitlements\x12@.google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest\x1a\x41.google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse\"\xae\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9e\x01\x12\x30/v1/{parent=projects/*/locations/*}/entitlementsZ7\x12\x35/v1/{parent=organizations/*/locations/*}/entitlementsZ1\x12//v1/{parent=folders/*/locations/*}/entitlements\x12\xda\x02\n\x12SearchEntitlements\x12\x42.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest\x1a\x43.google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse\"\xba\x01\x82\xd3\xe4\x93\x02\xb3\x01\x12\x37/v1/{parent=projects/*/locations/*}/entitlements:searchZ>\x12.google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest\x1a\x34.google.cloud.privilegedaccessmanager.v1.Entitlement\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01\x12\x30/v1/{name=projects/*/locations/*/entitlements/*}Z7\x12\x35/v1/{name=organizations/*/locations/*/entitlements/*}Z1\x12//v1/{name=folders/*/locations/*/entitlements/*}\x12\x8b\x03\n\x11\x43reateEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\x93\x02\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41!parent,entitlement,entitlement_id\x82\xd3\xe4\x93\x02\xc5\x01\"0/v1/{parent=projects/*/locations/*}/entitlements:\x0b\x65ntitlementZD\"5/v1/{parent=organizations/*/locations/*}/entitlements:\x0b\x65ntitlementZ>\"//v1/{parent=folders/*/locations/*}/entitlements:\x0b\x65ntitlement\x12\xc7\x02\n\x11\x44\x65leteEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\xcf\x01\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01*0/v1/{name=projects/*/locations/*/entitlements/*}Z7*5/v1/{name=organizations/*/locations/*/entitlements/*}Z1*//v1/{name=folders/*/locations/*/entitlements/*}\x12\xa5\x03\n\x11UpdateEntitlement\x12\x41.google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest\x1a\x1d.google.longrunning.Operation\"\xad\x02\xca\x41 \n\x0b\x45ntitlement\x12\x11OperationMetadata\xda\x41\x17\x65ntitlement,update_mask\x82\xd3\xe4\x93\x02\xe9\x01\x32/v1/{parent=organizations/*/locations/*/entitlements/*}/grantsZ:\x12\x38/v1/{parent=folders/*/locations/*/entitlements/*}/grants\x12\xe3\x02\n\x0cSearchGrants\x12<.google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest\x1a=.google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse\"\xd5\x01\x82\xd3\xe4\x93\x02\xce\x01\x12@/v1/{parent=projects/*/locations/*/entitlements/*}/grants:searchZG\x12\x45/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:searchZA\x12?/v1/{parent=folders/*/locations/*/entitlements/*}/grants:search\x12\xbe\x02\n\x08GetGrant\x12\x38.google.cloud.privilegedaccessmanager.v1.GetGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xc7\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb9\x01\x12\x39/v1/{name=projects/*/locations/*/entitlements/*/grants/*}Z@\x12>/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}Z:\x12\x38/v1/{name=folders/*/locations/*/entitlements/*/grants/*}\x12\xe1\x02\n\x0b\x43reateGrant\x12;.google.cloud.privilegedaccessmanager.v1.CreateGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xe4\x01\xda\x41\x0cparent,grant\x82\xd3\xe4\x93\x02\xce\x01\"9/v1/{parent=projects/*/locations/*/entitlements/*}/grants:\x05grantZG\">/v1/{parent=organizations/*/locations/*/entitlements/*}/grants:\x05grantZA\"8/v1/{parent=folders/*/locations/*/entitlements/*}/grants:\x05grant\x12\xe0\x02\n\x0c\x41pproveGrant\x12<.google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xe1\x01\x82\xd3\xe4\x93\x02\xda\x01\"A/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:approve:\x01*ZK\"F/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:approve:\x01*ZE\"@/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:approve:\x01*\x12\xd1\x02\n\tDenyGrant\x12\x39.google.cloud.privilegedaccessmanager.v1.DenyGrantRequest\x1a..google.cloud.privilegedaccessmanager.v1.Grant\"\xd8\x01\x82\xd3\xe4\x93\x02\xd1\x01\">/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:deny:\x01*ZH\"C/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:deny:\x01*ZB\"=/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:deny:\x01*\x12\xe7\x02\n\x0bRevokeGrant\x12;.google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest\x1a\x1d.google.longrunning.Operation\"\xfb\x01\xca\x41\x1a\n\x05Grant\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\xd7\x01\"@/v1/{name=projects/*/locations/*/entitlements/*/grants/*}:revoke:\x01*ZJ\"E/v1/{name=organizations/*/locations/*/entitlements/*/grants/*}:revoke:\x01*ZD\"?/v1/{name=folders/*/locations/*/entitlements/*/grants/*}:revoke:\x01*\x1aZ\xca\x41&privilegedaccessmanager.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x04\n+com.google.cloud.privilegedaccessmanager.v1B\x1cPrivilegedAccessManagerProtoP\x01Zecloud.google.com/go/privilegedaccessmanager/apiv1/privilegedaccessmanagerpb;privilegedaccessmanagerpb\xaa\x02\'Google.Cloud.PrivilegedAccessManager.V1\xca\x02\'Google\\Cloud\\PrivilegedAccessManager\\V1\xea\x02*Google::Cloud::PrivilegedAccessManager::V1\xea\x41p\n;privilegedaccessmanager.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41^\n5privilegedaccessmanager.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["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 PrivilegedAccessManager - module V1 - CheckOnboardingStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusRequest").msgclass - CheckOnboardingStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse").msgclass - CheckOnboardingStatusResponse::Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding").msgclass - CheckOnboardingStatusResponse::Finding::IAMAccessDenied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CheckOnboardingStatusResponse.Finding.IAMAccessDenied").msgclass - Entitlement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement").msgclass - Entitlement::RequesterJustificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig").msgclass - Entitlement::RequesterJustificationConfig::NotMandatory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.NotMandatory").msgclass - Entitlement::RequesterJustificationConfig::Unstructured = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.RequesterJustificationConfig.Unstructured").msgclass - Entitlement::AdditionalNotificationTargets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.AdditionalNotificationTargets").msgclass - Entitlement::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Entitlement.State").enummodule - AccessControlEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.AccessControlEntry").msgclass - ApprovalWorkflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ApprovalWorkflow").msgclass - ManualApprovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ManualApprovals").msgclass - ManualApprovals::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ManualApprovals.Step").msgclass - PrivilegedAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess").msgclass - PrivilegedAccess::GcpIamAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess").msgclass - PrivilegedAccess::GcpIamAccess::RoleBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding").msgclass - ListEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListEntitlementsRequest").msgclass - ListEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListEntitlementsResponse").msgclass - SearchEntitlementsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest").msgclass - SearchEntitlementsRequest::CallerAccessType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsRequest.CallerAccessType").enummodule - SearchEntitlementsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchEntitlementsResponse").msgclass - GetEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.GetEntitlementRequest").msgclass - CreateEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CreateEntitlementRequest").msgclass - DeleteEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.DeleteEntitlementRequest").msgclass - UpdateEntitlementRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.UpdateEntitlementRequest").msgclass - Grant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant").msgclass - Grant::Timeline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline").msgclass - Grant::Timeline::Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event").msgclass - Grant::Timeline::Event::Requested = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Requested").msgclass - Grant::Timeline::Event::Approved = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Approved").msgclass - Grant::Timeline::Event::Denied = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Denied").msgclass - Grant::Timeline::Event::Revoked = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Revoked").msgclass - Grant::Timeline::Event::Withdrawn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Withdrawn").msgclass - Grant::Timeline::Event::Scheduled = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Scheduled").msgclass - Grant::Timeline::Event::Activated = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Activated").msgclass - Grant::Timeline::Event::ActivationFailed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ActivationFailed").msgclass - Grant::Timeline::Event::Expired = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Expired").msgclass - Grant::Timeline::Event::Ended = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.Ended").msgclass - Grant::Timeline::Event::ExternallyModified = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.Timeline.Event.ExternallyModified").msgclass - Grant::AuditTrail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.AuditTrail").msgclass - Grant::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Grant.State").enummodule - Justification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.Justification").msgclass - ListGrantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListGrantsRequest").msgclass - ListGrantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ListGrantsResponse").msgclass - SearchGrantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest").msgclass - SearchGrantsRequest::CallerRelationshipType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsRequest.CallerRelationshipType").enummodule - SearchGrantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.SearchGrantsResponse").msgclass - GetGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.GetGrantRequest").msgclass - ApproveGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.ApproveGrantRequest").msgclass - DenyGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.DenyGrantRequest").msgclass - RevokeGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.RevokeGrantRequest").msgclass - CreateGrantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.CreateGrantRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.privilegedaccessmanager.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb deleted file mode 100644 index 3665cee309bb..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/lib/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb.rb +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.proto for package 'Google.Cloud.PrivilegedAccessManager.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/privilegedaccessmanager/v1/privilegedaccessmanager_pb' - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - module PrivilegedAccessManager - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager' - - # `CheckOnboardingStatus` reports the onboarding status for a - # project/folder/organization. Any findings reported by this API need to be - # fixed before PAM can be used on the resource. - rpc :CheckOnboardingStatus, ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse - # Lists entitlements in a given project/folder/organization and location. - rpc :ListEntitlements, ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse - # `SearchEntitlements` returns entitlements on which the caller has the - # specified access. - rpc :SearchEntitlements, ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse - # Gets details of a single entitlement. - rpc :GetEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement - # Creates a new entitlement in a given project/folder/organization and - # location. - rpc :CreateEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, ::Google::Longrunning::Operation - # Deletes a single entitlement. This method can only be called when there - # are no in-progress (`ACTIVE`/`ACTIVATING`/`REVOKING`) grants under the - # entitlement. - rpc :DeleteEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, ::Google::Longrunning::Operation - # Updates the entitlement specified in the request. Updated fields in the - # entitlement need to be specified in an update mask. The changes made to an - # entitlement are applicable only on future grants of the entitlement. - # However, if new approvers are added or existing approvers are removed from - # the approval workflow, the changes are effective on existing grants. - # - # The following fields are not supported for updates: - # - # * All immutable fields - # * Entitlement name - # * Resource name - # * Resource type - # * Adding an approval workflow in an entitlement which previously had no - # approval workflow. - # * Deleting the approval workflow from an entitlement. - # * Adding or deleting a step in the approval workflow (only one step is - # supported) - # - # Note that updates are allowed on the list of approvers in an approval - # workflow step. - rpc :UpdateEntitlement, ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, ::Google::Longrunning::Operation - # Lists grants for a given entitlement. - rpc :ListGrants, ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse - # `SearchGrants` returns grants that are related to the calling user in the - # specified way. - rpc :SearchGrants, ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse - # Get details of a single grant. - rpc :GetGrant, ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant - # Creates a new grant in a given project/folder/organization and - # location. - rpc :CreateGrant, ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant - # `ApproveGrant` is used to approve a grant. This method can only be called - # on a grant when it's in the `APPROVAL_AWAITED` state. This operation can't - # be undone. - rpc :ApproveGrant, ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant - # `DenyGrant` is used to deny a grant. This method can only be called on a - # grant when it's in the `APPROVAL_AWAITED` state. This operation can't be - # undone. - rpc :DenyGrant, ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, ::Google::Cloud::PrivilegedAccessManager::V1::Grant - # `RevokeGrant` is used to immediately revoke access for a grant. This method - # can be called when the grant is in a non-terminal state. - rpc :RevokeGrant, ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md deleted file mode 100644 index 0a202904453e..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Privileged Access 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-privileged_access_manager-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.rb deleted file mode 100644 index 6cb539ee39ed..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager.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! - - -module Google - module Cloud - module PrivilegedAccessManager - module V1 - # Request message for `CheckOnboardingStatus` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource for which the onboarding status should be checked. - # Should be in one of the following formats: - # - # * `projects/{project-number|project-id}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `organizations/{organization-number}/locations/{region}` - class CheckOnboardingStatusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `CheckOnboardingStatus` method. - # @!attribute [rw] service_account - # @return [::String] - # The service account that PAM uses to act on this resource. - # @!attribute [rw] findings - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse::Finding>] - # List of issues that are preventing PAM from functioning for this resource - # and need to be fixed to complete onboarding. Some issues might not be - # detected or reported. - class CheckOnboardingStatusResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Finding represents an issue which prevents PAM from functioning properly - # for this resource. - # @!attribute [rw] iam_access_denied - # @return [::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse::Finding::IAMAccessDenied] - # PAM's service account is being denied access by Cloud IAM. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # PAM's service account is being denied access by Cloud IAM. - # This can be fixed by granting a role that contains the missing - # permissions to the service account or exempting it from deny policies if - # they are blocking the access. - # @!attribute [rw] missing_permissions - # @return [::Array<::String>] - # List of permissions that are being denied. - class IAMAccessDenied - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # An entitlement defines the eligibility of a set of users to obtain - # predefined access for some time possibly after going through an approval - # workflow. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name of the entitlement. - # Possible formats: - # - # * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}` - # * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}` - # * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp. - # @!attribute [rw] eligible_users - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::AccessControlEntry>] - # Optional. Who can create grants using this entitlement. This list should - # contain at most one entry. - # @!attribute [rw] approval_workflow - # @return [::Google::Cloud::PrivilegedAccessManager::V1::ApprovalWorkflow] - # Optional. The approvals needed before access are granted to a requester. No - # approvals are needed if this field is null. - # @!attribute [rw] privileged_access - # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess] - # The access granted to a requester on successful approval. - # @!attribute [rw] max_request_duration - # @return [::Google::Protobuf::Duration] - # Required. The maximum amount of time that access is granted for a request. - # A requester can ask for a duration less than this, but never more. - # @!attribute [r] state - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::State] - # Output only. Current state of this entitlement. - # @!attribute [rw] requester_justification_config - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig] - # Required. The manner in which the requester should provide a justification - # for requesting access. - # @!attribute [rw] additional_notification_targets - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::AdditionalNotificationTargets] - # Optional. Additional email addresses to be notified based on actions taken. - # @!attribute [rw] etag - # @return [::String] - # An `etag` is used for optimistic concurrency control as a way to prevent - # simultaneous updates to the same entitlement. An `etag` is returned in the - # response to `GetEntitlement` and the caller should put the `etag` in the - # request to `UpdateEntitlement` so that their change is applied on - # the same version. If this field is omitted or if there is a mismatch while - # updating an entitlement, then the server rejects the request. - class Entitlement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines how a requester must provide a justification when requesting - # access. - # @!attribute [rw] not_mandatory - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig::NotMandatory] - # This option means the requester isn't required to provide a - # justification. - # - # Note: The following fields are mutually exclusive: `not_mandatory`, `unstructured`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] unstructured - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement::RequesterJustificationConfig::Unstructured] - # This option means the requester must provide a string as - # justification. If this is selected, the server allows the requester - # to provide a justification but doesn't validate it. - # - # Note: The following fields are mutually exclusive: `unstructured`, `not_mandatory`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RequesterJustificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The justification is not mandatory but can be provided in any of the - # supported formats. - class NotMandatory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The requester has to provide a justification in the form of a string. - class Unstructured - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `AdditionalNotificationTargets` includes email addresses to be notified. - # @!attribute [rw] admin_email_recipients - # @return [::Array<::String>] - # Optional. Additional email addresses to be notified when a principal - # (requester) is granted access. - # @!attribute [rw] requester_email_recipients - # @return [::Array<::String>] - # Optional. Additional email address to be notified about an eligible - # entitlement. - class AdditionalNotificationTargets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Different states an entitlement can be in. - module State - # Unspecified state. This value is never returned by the server. - STATE_UNSPECIFIED = 0 - - # The entitlement is being created. - CREATING = 1 - - # The entitlement is available for requesting access. - AVAILABLE = 2 - - # The entitlement is being deleted. - DELETING = 3 - - # The entitlement has been deleted. - DELETED = 4 - - # The entitlement is being updated. - UPDATING = 5 - end - end - - # `AccessControlEntry` is used to control who can do some operation. - # @!attribute [rw] principals - # @return [::Array<::String>] - # Optional. Users who are allowed for the operation. Each entry should be a - # valid v1 IAM principal identifier. The format for these is documented at: - # https://cloud.google.com/iam/docs/principal-identifiers#v1 - class AccessControlEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Different types of approval workflows that can be used to gate privileged - # access granting. - # @!attribute [rw] manual_approvals - # @return [::Google::Cloud::PrivilegedAccessManager::V1::ManualApprovals] - # An approval workflow where users designated as approvers review and act - # on the grants. - class ApprovalWorkflow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A manual approval workflow where users who are designated as approvers - # need to call the `ApproveGrant`/`DenyGrant` APIs for a grant. The workflow - # can consist of multiple serial steps where each step defines who can act as - # approver in that step and how many of those users should approve before the - # workflow moves to the next step. - # - # This can be used to create approval workflows such as: - # - # * Require an approval from any user in a group G. - # * Require an approval from any k number of users from a Group G. - # * Require an approval from any user in a group G and then from a user U. - # - # A single user might be part of the `approvers` ACL for multiple steps in this - # workflow, but they can only approve once and that approval is only considered - # to satisfy the approval step at which it was granted. - # @!attribute [rw] require_approver_justification - # @return [::Boolean] - # Optional. Do the approvers need to provide a justification for their - # actions? - # @!attribute [rw] steps - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::ManualApprovals::Step>] - # Optional. List of approval steps in this workflow. These steps are followed - # in the specified order sequentially. Only 1 step is supported. - class ManualApprovals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Step represents a logical step in a manual approval workflow. - # @!attribute [rw] approvers - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::AccessControlEntry>] - # Optional. The potential set of approvers in this step. This list must - # contain at most one entry. - # @!attribute [rw] approvals_needed - # @return [::Integer] - # Required. How many users from the above list need to approve. If there - # aren't enough distinct users in the list, then the workflow indefinitely - # blocks. Should always be greater than 0. 1 is the only supported value. - # @!attribute [rw] approver_email_recipients - # @return [::Array<::String>] - # Optional. Additional email addresses to be notified when a grant is - # pending approval. - class Step - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Privileged access that this service can be used to gate. - # @!attribute [rw] gcp_iam_access - # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess::GcpIamAccess] - # Access to a Google Cloud resource through IAM. - class PrivilegedAccess - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # `GcpIamAccess` represents IAM based access control on a Google Cloud - # resource. Refer to https://cloud.google.com/iam/docs to understand more - # about IAM. - # @!attribute [rw] resource_type - # @return [::String] - # Required. The type of this resource. - # @!attribute [rw] resource - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] role_bindings - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess::GcpIamAccess::RoleBinding>] - # Required. Role bindings that are created on successful grant. - class GcpIamAccess - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # IAM role bindings that are created after a successful grant. - # @!attribute [rw] role - # @return [::String] - # Required. IAM role to be granted. - # https://cloud.google.com/iam/docs/roles-overview. - # @!attribute [rw] condition_expression - # @return [::String] - # Optional. The expression field of the IAM condition to be associated - # with the role. If specified, a user with an active grant for this - # entitlement is able to access the resource only if this condition - # evaluates to true for their request. - # - # This field uses the same CEL format as IAM and supports all attributes - # that IAM supports, except tags. - # https://cloud.google.com/iam/docs/conditions-overview#attributes. - class RoleBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Message for requesting list of entitlements. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent which owns the entitlement resources. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, the server picks 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. Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results. - class ListEntitlementsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing entitlements. - # @!attribute [rw] entitlements - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # The list of entitlements. - # @!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 ListEntitlementsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `SearchEntitlements` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent which owns the entitlement resources. - # @!attribute [rw] caller_access_type - # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest::CallerAccessType] - # Required. Only entitlements where the calling user has this access are - # returned. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only entitlements matching this filter are returned in the - # response. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class SearchEntitlementsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Different types of access a user can have on the entitlement resource. - module CallerAccessType - # Unspecified access type. - CALLER_ACCESS_TYPE_UNSPECIFIED = 0 - - # The user has access to create grants using this entitlement. - GRANT_REQUESTER = 1 - - # The user has access to approve/deny grants created under this - # entitlement. - GRANT_APPROVER = 2 - end - end - - # Response message for `SearchEntitlements` method. - # @!attribute [rw] entitlements - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Entitlement>] - # The list of entitlements. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class SearchEntitlementsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting an entitlement. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetEntitlementRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating an entitlement. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent resource for the entitlement. - # Possible formats: - # - # * `organizations/{organization-number}/locations/{region}` - # * `folders/{folder-number}/locations/{region}` - # * `projects/{project-id|project-number}/locations/{region}` - # @!attribute [rw] entitlement_id - # @return [::String] - # Required. The ID to use for this entitlement. This becomes the last part of - # the resource name. - # - # This value should be 4-63 characters in length, and valid characters are - # "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. - # - # This value should be unique among all other entitlements under the - # specified `parent`. - # @!attribute [rw] entitlement - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # 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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request and returns the - # previous operation's response. This prevents clients from accidentally - # creating duplicate entitlements. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateEntitlementRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting an entitlement. - # @!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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set to true, any child grant under this entitlement is also - # deleted. (Otherwise, the request only works if the entitlement has no child - # grant.) - class DeleteEntitlementRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating an entitlement. - # @!attribute [rw] entitlement - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Entitlement] - # Required. The entitlement resource that is updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The list of fields to update. A field is overwritten if, and only - # if, it is in the mask. Any immutable fields set in the mask are ignored by - # the server. Repeated fields and map fields are only allowed in the last - # position of a `paths` string and overwrite the existing values. Hence an - # update to a repeated field or a map should contain the entire list of - # values. The fields specified in the update_mask are relative to the - # resource and not to the request. - # (e.g. `MaxRequestDuration`; *not* `entitlement.MaxRequestDuration`) - # A value of '*' for this field refers to full replacement of the resource. - class UpdateEntitlementRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A grant represents a request from a user for obtaining the access specified - # in an entitlement they are eligible for. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name of this grant. - # Possible formats: - # - # * `organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - # * `folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - # * `projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}/grants/{grant-id}` - # - # The last segment of this name (`{grant-id}`) is autogenerated. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp. - # @!attribute [r] requester - # @return [::String] - # Output only. Username of the user who created this grant. - # @!attribute [rw] requested_duration - # @return [::Google::Protobuf::Duration] - # Required. The amount of time access is needed for. This value should be - # less than the `max_request_duration` value of the entitlement. - # @!attribute [rw] justification - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Justification] - # Optional. Justification of why this access is needed. - # @!attribute [r] state - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::State] - # Output only. Current state of this grant. - # @!attribute [r] timeline - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline] - # Output only. Timeline of this grant. - # @!attribute [r] privileged_access - # @return [::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccess] - # Output only. The access that would be granted by this grant. - # @!attribute [r] audit_trail - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::AuditTrail] - # Output only. Audit trail of access provided by this grant. If unspecified - # then access was never granted. - # @!attribute [rw] additional_email_recipients - # @return [::Array<::String>] - # Optional. Additional email addresses to notify for all the actions - # performed on the grant. - # @!attribute [r] externally_modified - # @return [::Boolean] - # Output only. Flag set by the PAM system to indicate that policy bindings - # made by this grant have been modified from outside PAM. - # - # After it is set, this flag remains set forever irrespective of the grant - # state. A `true` value here indicates that PAM no longer has any certainty - # on the access a user has because of this grant. - class Grant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Timeline of a grant describing what happened to it and when. - # @!attribute [r] events - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event>] - # Output only. The events that have occurred on this grant. This list - # contains entries in the same order as they occurred. The first entry is - # always be of type `Requested` and there is always at least one entry in - # this array. - class Timeline - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single operation on the grant. - # @!attribute [rw] requested - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Requested] - # The grant was requested. - # - # Note: The following fields are mutually exclusive: `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] approved - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Approved] - # The grant was approved. - # - # Note: The following fields are mutually exclusive: `approved`, `requested`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] denied - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Denied] - # The grant was denied. - # - # Note: The following fields are mutually exclusive: `denied`, `requested`, `approved`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] revoked - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Revoked] - # The grant was revoked. - # - # Note: The following fields are mutually exclusive: `revoked`, `requested`, `approved`, `denied`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] scheduled - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Scheduled] - # The grant has been scheduled to give access. - # - # Note: The following fields are mutually exclusive: `scheduled`, `requested`, `approved`, `denied`, `revoked`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] activated - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Activated] - # The grant was successfully activated to give access. - # - # Note: The following fields are mutually exclusive: `activated`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activation_failed`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] activation_failed - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::ActivationFailed] - # There was a non-retriable error while trying to give access. - # - # Note: The following fields are mutually exclusive: `activation_failed`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `expired`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] expired - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Expired] - # The approval workflow did not complete in the necessary duration, - # and so the grant is expired. - # - # Note: The following fields are mutually exclusive: `expired`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `ended`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ended - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Ended] - # Access given by the grant ended automatically as the approved - # duration was over. - # - # Note: The following fields are mutually exclusive: `ended`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `externally_modified`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] externally_modified - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::ExternallyModified] - # The policy bindings made by grant have been modified outside of PAM. - # - # Note: The following fields are mutually exclusive: `externally_modified`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `withdrawn`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] withdrawn - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant::Timeline::Event::Withdrawn] - # The grant was withdrawn. - # - # Note: The following fields are mutually exclusive: `withdrawn`, `requested`, `approved`, `denied`, `revoked`, `scheduled`, `activated`, `activation_failed`, `expired`, `ended`, `externally_modified`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] event_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time (as recorded at server) when this event occurred. - class Event - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An event representing that a grant was requested. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this grant expires unless the approval - # workflow completes. If omitted, then the request never expires. - class Requested - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was approved. - # @!attribute [r] reason - # @return [::String] - # Output only. The reason provided by the approver for approving the - # grant. - # @!attribute [r] actor - # @return [::String] - # Output only. Username of the user who approved the grant. - class Approved - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was denied. - # @!attribute [r] reason - # @return [::String] - # Output only. The reason provided by the approver for denying the - # grant. - # @!attribute [r] actor - # @return [::String] - # Output only. Username of the user who denied the grant. - class Denied - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was revoked. - # @!attribute [r] reason - # @return [::String] - # Output only. The reason provided by the user for revoking the grant. - # @!attribute [r] actor - # @return [::String] - # Output only. Username of the user who revoked the grant. - class Revoked - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was withdrawn. - class Withdrawn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant has been scheduled to be - # activated later. - # @!attribute [r] scheduled_activation_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the access is granted. - class Scheduled - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was successfully - # activated. - class Activated - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant activation failed. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. The error that occurred while activating the grant. - class ActivationFailed - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant was expired. - class Expired - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the grant has ended. - class Ended - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event representing that the policy bindings made by this grant were - # modified externally. - class ExternallyModified - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Audit trail for the access provided by this grant. - # @!attribute [r] access_grant_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which access was given. - # @!attribute [r] access_remove_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the system removed access. This could be - # because of an automatic expiry or because of a revocation. - # - # If unspecified, then access hasn't been removed yet. - class AuditTrail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Different states a grant can be in. - module State - # Unspecified state. This value is never returned by the server. - STATE_UNSPECIFIED = 0 - - # The entitlement had an approval workflow configured and this grant is - # waiting for the workflow to complete. - APPROVAL_AWAITED = 1 - - # The approval workflow completed with a denied result. No access is - # granted for this grant. This is a terminal state. - DENIED = 3 - - # The approval workflow completed successfully with an approved result or - # none was configured. Access is provided at an appropriate time. - SCHEDULED = 4 - - # Access is being given. - ACTIVATING = 5 - - # Access was successfully given and is currently active. - ACTIVE = 6 - - # The system could not give access due to a non-retriable error. This is a - # terminal state. - ACTIVATION_FAILED = 7 - - # Expired after waiting for the approval workflow to complete. This is a - # terminal state. - EXPIRED = 8 - - # Access is being revoked. - REVOKING = 9 - - # Access was revoked by a user. This is a terminal state. - REVOKED = 10 - - # System took back access as the requested duration was over. This is a - # terminal state. - ENDED = 11 - - # Access is being withdrawn. - WITHDRAWING = 12 - - # Grant was withdrawn by the grant owner. This is a terminal state. - WITHDRAWN = 13 - end - end - - # Justification represents a justification for requesting access. - # @!attribute [rw] unstructured_justification - # @return [::String] - # A free form textual justification. The system only ensures that this - # is not empty. No other kind of validation is performed on the string. - class Justification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of grants. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource which owns the grants. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, the server picks 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. Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results - class ListGrantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing grants. - # @!attribute [rw] grants - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # The list of grants. - # @!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 ListGrantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `SearchGrants` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent which owns the grant resources. - # @!attribute [rw] caller_relationship - # @return [::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest::CallerRelationshipType] - # Required. Only grants which the caller is related to by this relationship - # are returned in the response. - # @!attribute [rw] filter - # @return [::String] - # Optional. Only grants matching this filter are returned in the response. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer items than - # requested. If unspecified, server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class SearchGrantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Different types of relationships a user can have with a grant. - module CallerRelationshipType - # Unspecified caller relationship type. - CALLER_RELATIONSHIP_TYPE_UNSPECIFIED = 0 - - # The user created this grant by calling `CreateGrant` earlier. - HAD_CREATED = 1 - - # The user is an approver for the entitlement that this grant is parented - # under and can currently approve/deny it. - CAN_APPROVE = 2 - - # The caller had successfully approved/denied this grant earlier. - HAD_APPROVED = 3 - end - end - - # Response message for `SearchGrants` method. - # @!attribute [rw] grants - # @return [::Array<::Google::Cloud::PrivilegedAccessManager::V1::Grant>] - # The list of grants. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class SearchGrantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a grant. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetGrantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `ApproveGrant` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the grant resource which is being approved. - # @!attribute [rw] reason - # @return [::String] - # Optional. The reason for approving this grant. This is required if the - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - class ApproveGrantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `DenyGrant` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the grant resource which is being denied. - # @!attribute [rw] reason - # @return [::String] - # Optional. The reason for denying this grant. This is required if - # `require_approver_justification` field of the `ManualApprovals` workflow - # used in this grant is true. - class DenyGrantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `RevokeGrant` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the grant resource which is being revoked. - # @!attribute [rw] reason - # @return [::String] - # Optional. The reason for revoking this grant. - class RevokeGrantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a grant - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent entitlement for which this grant is being - # requested. - # @!attribute [rw] grant - # @return [::Google::Cloud::PrivilegedAccessManager::V1::Grant] - # 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 knows to - # ignore the request if it has already been completed. The server guarantees - # this 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, ignores the second request. This prevents - # clients from accidentally creating duplicate grants. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateGrantRequest - 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 been cancelled successfully - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/Gemfile deleted file mode 100644 index a8a6a830930c..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager-v1", path: "../" -else - gem "google-cloud-privileged_access_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-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb deleted file mode 100644 index 52b1b20616bd..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/approve_grant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the approve_grant call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant. -# -def approve_grant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new - - # Call the approve_grant method. - result = client.approve_grant request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb deleted file mode 100644 index 640c7c98fa01..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/check_onboarding_status.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the check_onboarding_status call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status. -# -def check_onboarding_status - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new - - # Call the check_onboarding_status method. - result = client.check_onboarding_status request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.rb deleted file mode 100644 index 563753d91a87..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the create_entitlement call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement. -# -def create_entitlement - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new - - # Call the create_entitlement method. - result = client.create_entitlement request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb deleted file mode 100644 index 9834cd29890b..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/create_grant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the create_grant call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant. -# -def create_grant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new - - # Call the create_grant method. - result = client.create_grant request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.rb deleted file mode 100644 index 853407d3fe05..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/delete_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the delete_entitlement call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement. -# -def delete_entitlement - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new - - # Call the delete_entitlement method. - result = client.delete_entitlement request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb deleted file mode 100644 index 2d0614604a9b..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/deny_grant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the deny_grant call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant. -# -def deny_grant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new - - # Call the deny_grant method. - result = client.deny_grant request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb deleted file mode 100644 index f5d6232e72eb..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_entitlement.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the get_entitlement call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement. -# -def get_entitlement - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new - - # Call the get_entitlement method. - result = client.get_entitlement request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb deleted file mode 100644 index c7736a63daf3..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/get_grant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the get_grant call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant. -# -def get_grant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new - - # Call the get_grant method. - result = client.get_grant request - - # The returned object is of type Google::Cloud::PrivilegedAccessManager::V1::Grant. - p result -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.rb deleted file mode 100644 index c8f615dcb603..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_entitlements.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the list_entitlements call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements. -# -def list_entitlements - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.new - - # Call the list_entitlements method. - result = client.list_entitlements request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - p item - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.rb deleted file mode 100644 index ec4ab2e2bfe7..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/list_grants.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the list_grants call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants. -# -def list_grants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.new - - # Call the list_grants method. - result = client.list_grants request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - p item - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.rb deleted file mode 100644 index 268612420952..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/revoke_grant.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the revoke_grant call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant. -# -def revoke_grant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new - - # Call the revoke_grant method. - result = client.revoke_grant request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.rb deleted file mode 100644 index 6ead02e2f736..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_entitlements.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the search_entitlements call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements. -# -def search_entitlements - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new - - # Call the search_entitlements method. - result = client.search_entitlements request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement. - p item - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.rb deleted file mode 100644 index 4751360e4c54..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/search_grants.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the search_grants call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants. -# -def search_grants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new - - # Call the search_grants method. - result = client.search_grants request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PrivilegedAccessManager::V1::Grant. - p item - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.rb deleted file mode 100644 index 5008d00b64aa..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/privileged_access_manager/update_entitlement.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 privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] -require "google/cloud/privileged_access_manager/v1" - -## -# Snippet for the update_entitlement call in the PrivilegedAccessManager service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement. -# -def update_entitlement - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new - - # Call the update_entitlement method. - result = client.update_entitlement request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync] diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json b/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json deleted file mode 100644 index 7b95f32dc0dd..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/snippets/snippet_metadata_google.cloud.privilegedaccessmanager.v1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-privileged_access_manager-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.privilegedaccessmanager.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CheckOnboardingStatus_sync", - "title": "Snippet for the check_onboarding_status call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status.", - "file": "privileged_access_manager/check_onboarding_status.rb", - "language": "RUBY", - "client_method": { - "short_name": "check_onboarding_status", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#check_onboarding_status", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "CheckOnboardingStatus", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CheckOnboardingStatus", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListEntitlements_sync", - "title": "Snippet for the list_entitlements call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements.", - "file": "privileged_access_manager/list_entitlements.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_entitlements", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_entitlements", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "ListEntitlements", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ListEntitlements", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchEntitlements_sync", - "title": "Snippet for the search_entitlements call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements.", - "file": "privileged_access_manager/search_entitlements.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_entitlements", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_entitlements", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "SearchEntitlements", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.SearchEntitlements", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetEntitlement_sync", - "title": "Snippet for the get_entitlement call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement.", - "file": "privileged_access_manager/get_entitlement.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_entitlement", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_entitlement", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Entitlement", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "GetEntitlement", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.GetEntitlement", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateEntitlement_sync", - "title": "Snippet for the create_entitlement call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement.", - "file": "privileged_access_manager/create_entitlement.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_entitlement", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_entitlement", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "CreateEntitlement", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CreateEntitlement", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DeleteEntitlement_sync", - "title": "Snippet for the delete_entitlement call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement.", - "file": "privileged_access_manager/delete_entitlement.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_entitlement", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#delete_entitlement", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "DeleteEntitlement", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.DeleteEntitlement", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_UpdateEntitlement_sync", - "title": "Snippet for the update_entitlement call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement.", - "file": "privileged_access_manager/update_entitlement.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_entitlement", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#update_entitlement", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "UpdateEntitlement", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.UpdateEntitlement", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ListGrants_sync", - "title": "Snippet for the list_grants call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants.", - "file": "privileged_access_manager/list_grants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_grants", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#list_grants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "ListGrants", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ListGrants", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_SearchGrants_sync", - "title": "Snippet for the search_grants call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants.", - "file": "privileged_access_manager/search_grants.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_grants", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#search_grants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "SearchGrants", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.SearchGrants", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_GetGrant_sync", - "title": "Snippet for the get_grant call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant.", - "file": "privileged_access_manager/get_grant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_grant", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#get_grant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "GetGrant", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.GetGrant", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_CreateGrant_sync", - "title": "Snippet for the create_grant call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant.", - "file": "privileged_access_manager/create_grant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_grant", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#create_grant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "CreateGrant", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.CreateGrant", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_ApproveGrant_sync", - "title": "Snippet for the approve_grant call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant.", - "file": "privileged_access_manager/approve_grant.rb", - "language": "RUBY", - "client_method": { - "short_name": "approve_grant", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#approve_grant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "ApproveGrant", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.ApproveGrant", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_DenyGrant_sync", - "title": "Snippet for the deny_grant call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant.", - "file": "privileged_access_manager/deny_grant.rb", - "language": "RUBY", - "client_method": { - "short_name": "deny_grant", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#deny_grant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PrivilegedAccessManager::V1::Grant", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "DenyGrant", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.DenyGrant", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "privilegedaccessmanager_v1_generated_PrivilegedAccessManager_RevokeGrant_sync", - "title": "Snippet for the revoke_grant call in the PrivilegedAccessManager service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant.", - "file": "privileged_access_manager/revoke_grant.rb", - "language": "RUBY", - "client_method": { - "short_name": "revoke_grant", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client#revoke_grant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrivilegedAccessManager::Client", - "full_name": "::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client" - }, - "method": { - "short_name": "RevokeGrant", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager.RevokeGrant", - "service": { - "short_name": "PrivilegedAccessManager", - "full_name": "google.cloud.privilegedaccessmanager.v1.PrivilegedAccessManager" - } - } - }, - "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-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_operations_test.rb deleted file mode 100644 index 9375f0cfd630..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_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/privilegedaccessmanager/v1/privilegedaccessmanager_pb" -require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_services_pb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager" - -class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_paths_test.rb deleted file mode 100644 index 461700b707ac..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_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/privileged_access_manager/v1/privileged_access_manager" - -class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_entitlement_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entitlement_path project: "value0", location: "value1", entitlement: "value2" - assert_equal "projects/value0/locations/value1/entitlements/value2", path - - path = client.entitlement_path folder: "value0", location: "value1", entitlement: "value2" - assert_equal "folders/value0/locations/value1/entitlements/value2", path - - path = client.entitlement_path organization: "value0", location: "value1", entitlement: "value2" - assert_equal "organizations/value0/locations/value1/entitlements/value2", path - end - end - - def test_folder_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_location_path folder: "value0", location: "value1" - assert_equal "folders/value0/locations/value1", path - end - end - - def test_grant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.grant_path project: "value0", location: "value1", entitlement: "value2", grant: "value3" - assert_equal "projects/value0/locations/value1/entitlements/value2/grants/value3", path - - path = client.grant_path folder: "value0", location: "value1", entitlement: "value2", grant: "value3" - assert_equal "folders/value0/locations/value1/entitlements/value2/grants/value3", path - - path = client.grant_path organization: "value0", location: "value1", entitlement: "value2", grant: "value3" - assert_equal "organizations/value0/locations/value1/entitlements/value2/grants/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_organization_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_location_path organization: "value0", location: "value1" - assert_equal "organizations/value0/locations/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb deleted file mode 100644 index be14d76ac294..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_rest_test.rb +++ /dev/null @@ -1,882 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/privilegedaccessmanager/v1/privilegedaccessmanager_pb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager/rest" - - -class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_check_onboarding_status - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - check_onboarding_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_check_onboarding_status_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, check_onboarding_status_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.check_onboarding_status({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.check_onboarding_status parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.check_onboarding_status ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.check_onboarding_status({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.check_onboarding_status(::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, check_onboarding_status_client_stub.call_count - end - end - end - - def test_list_entitlements - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.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_entitlements_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_list_entitlements_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_entitlements_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_entitlements({ 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_entitlements 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_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements({ 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_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements_client_stub.call_count - end - end - end - - def test_search_entitlements - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - caller_access_type = :CALLER_ACCESS_TYPE_UNSPECIFIED - filter = "hello world" - page_size = 42 - page_token = "hello world" - - search_entitlements_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_search_entitlements_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_entitlements_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_entitlements parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_entitlements_client_stub.call_count - end - end - end - - def test_get_entitlement - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_get_entitlement_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_entitlement({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_entitlement name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_entitlement({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_entitlement_client_stub.call_count - end - end - end - - def test_create_entitlement - # Create test objects. - 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" - entitlement_id = "hello world" - entitlement = {} - request_id = "hello world" - - create_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_create_entitlement_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_entitlement parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_entitlement_client_stub.call_count - end - end - end - - def test_delete_entitlement - # Create test objects. - 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" - force = true - - delete_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_delete_entitlement_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_entitlement({ name: name, request_id: request_id, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_entitlement name: name, request_id: request_id, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_entitlement({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_entitlement_client_stub.call_count - end - end - end - - def test_update_entitlement - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - entitlement = {} - update_mask = {} - - update_entitlement_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_update_entitlement_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_entitlement({ entitlement: entitlement, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_entitlement entitlement: entitlement, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_entitlement({ entitlement: entitlement, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_entitlement_client_stub.call_count - end - end - end - - def test_list_grants - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.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_grants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_list_grants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_grants_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_grants({ 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_grants 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_grants ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants({ 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_grants(::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants_client_stub.call_count - end - end - end - - def test_search_grants - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - caller_relationship = :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED - filter = "hello world" - page_size = 42 - page_token = "hello world" - - search_grants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_search_grants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_grants_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_grants parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_grants ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_grants(::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_grants_client_stub.call_count - end - end - end - - def test_get_grant - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_get_grant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_grant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_grant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_grant ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_grant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_grant(::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_grant_client_stub.call_count - end - end - end - - def test_create_grant - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - grant = {} - request_id = "hello world" - - create_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_create_grant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_grant({ parent: parent, grant: grant, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_grant parent: parent, grant: grant, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_grant ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_grant({ parent: parent, grant: grant, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_grant(::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_grant_client_stub.call_count - end - end - end - - def test_approve_grant - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = "hello world" - - approve_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_approve_grant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, approve_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.approve_grant({ name: name, reason: reason }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.approve_grant name: name, reason: reason do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.approve_grant ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.approve_grant({ name: name, reason: reason }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.approve_grant(::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, approve_grant_client_stub.call_count - end - end - end - - def test_deny_grant - # Create test objects. - client_result = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = "hello world" - - deny_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_deny_grant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deny_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.deny_grant({ name: name, reason: reason }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.deny_grant name: name, reason: reason do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.deny_grant ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.deny_grant({ name: name, reason: reason }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.deny_grant(::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deny_grant_client_stub.call_count - end - end - end - - def test_revoke_grant - # Create test objects. - 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" - reason = "hello world" - - revoke_grant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::ServiceStub.stub :transcode_revoke_grant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, revoke_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.revoke_grant({ name: name, reason: reason }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.revoke_grant name: name, reason: reason do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.revoke_grant ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.revoke_grant({ name: name, reason: reason }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.revoke_grant(::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, revoke_grant_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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb deleted file mode 100644 index baa180203613..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/google/cloud/privileged_access_manager/v1/privileged_access_manager_test.rb +++ /dev/null @@ -1,1024 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/privilegedaccessmanager/v1/privilegedaccessmanager_pb" -require "google/cloud/privileged_access_manager/v1/privileged_access_manager" - -class ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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_check_onboarding_status - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - check_onboarding_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :check_onboarding_status, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, check_onboarding_status_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.check_onboarding_status({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.check_onboarding_status parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.check_onboarding_status ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.check_onboarding_status({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.check_onboarding_status(::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.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, check_onboarding_status_client_stub.call_rpc_count - end - end - - def test_list_entitlements - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_entitlements_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_entitlements, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest, 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_entitlements_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_entitlements({ 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_entitlements 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_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements({ 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_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::ListEntitlementsRequest.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_entitlements_client_stub.call_rpc_count - end - end - - def test_search_entitlements - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - caller_access_type = :CALLER_ACCESS_TYPE_UNSPECIFIED - filter = "hello world" - page_size = 42 - page_token = "hello world" - - search_entitlements_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_entitlements, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :CALLER_ACCESS_TYPE_UNSPECIFIED, request["caller_access_type"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_entitlements_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_entitlements parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_entitlements ::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_entitlements({ parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_entitlements(::Google::Cloud::PrivilegedAccessManager::V1::SearchEntitlementsRequest.new(parent: parent, caller_access_type: caller_access_type, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_entitlements_client_stub.call_rpc_count - end - end - - def test_get_entitlement - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_entitlement, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_entitlement({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_entitlement name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_entitlement({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::GetEntitlementRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_entitlement_client_stub.call_rpc_count - end - end - - def test_create_entitlement - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - entitlement_id = "hello world" - entitlement = {} - request_id = "hello world" - - create_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_entitlement, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["entitlement_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement), request["entitlement"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement({ parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::CreateEntitlementRequest.new(parent: parent, entitlement_id: entitlement_id, entitlement: entitlement, 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_entitlement_client_stub.call_rpc_count - end - end - - def test_delete_entitlement - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - force = true - - delete_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_entitlement, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_entitlement({ name: name, request_id: request_id, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_entitlement name: name, request_id: request_id, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_entitlement({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::DeleteEntitlementRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_entitlement_client_stub.call_rpc_count - end - end - - def test_update_entitlement - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - entitlement = {} - update_mask = {} - - update_entitlement_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_entitlement, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Entitlement), request["entitlement"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_entitlement_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_entitlement({ entitlement: entitlement, 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_entitlement entitlement: entitlement, 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_entitlement ::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, 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_entitlement({ entitlement: entitlement, 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_entitlement(::Google::Cloud::PrivilegedAccessManager::V1::UpdateEntitlementRequest.new(entitlement: entitlement, 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_entitlement_client_stub.call_rpc_count - end - end - - def test_list_grants - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_grants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_grants, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest, 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_grants_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_grants({ 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_grants 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_grants ::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants({ 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_grants(::Google::Cloud::PrivilegedAccessManager::V1::ListGrantsRequest.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_grants_client_stub.call_rpc_count - end - end - - def test_search_grants - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - caller_relationship = :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED - filter = "hello world" - page_size = 42 - page_token = "hello world" - - search_grants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_grants, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :CALLER_RELATIONSHIP_TYPE_UNSPECIFIED, request["caller_relationship"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_grants_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_grants parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_grants ::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_grants({ parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_grants(::Google::Cloud::PrivilegedAccessManager::V1::SearchGrantsRequest.new(parent: parent, caller_relationship: caller_relationship, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_grants_client_stub.call_rpc_count - end - end - - def test_get_grant - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_grant, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_grant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_grant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_grant ::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_grant({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_grant(::Google::Cloud::PrivilegedAccessManager::V1::GetGrantRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_grant_client_stub.call_rpc_count - end - end - - def test_create_grant - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - grant = {} - request_id = "hello world" - - create_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_grant, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PrivilegedAccessManager::V1::Grant), request["grant"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_grant({ parent: parent, grant: grant, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_grant parent: parent, grant: grant, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_grant ::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, 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_grant({ parent: parent, grant: grant, 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_grant(::Google::Cloud::PrivilegedAccessManager::V1::CreateGrantRequest.new(parent: parent, grant: grant, 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_grant_client_stub.call_rpc_count - end - end - - def test_approve_grant - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = "hello world" - - approve_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :approve_grant, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["reason"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, approve_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.approve_grant({ name: name, reason: reason }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.approve_grant name: name, reason: reason do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.approve_grant ::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.approve_grant({ name: name, reason: reason }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.approve_grant(::Google::Cloud::PrivilegedAccessManager::V1::ApproveGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, approve_grant_client_stub.call_rpc_count - end - end - - def test_deny_grant - # Create GRPC objects. - grpc_response = ::Google::Cloud::PrivilegedAccessManager::V1::Grant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = "hello world" - - deny_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deny_grant, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["reason"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deny_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deny_grant({ name: name, reason: reason }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.deny_grant name: name, reason: reason do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.deny_grant ::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.deny_grant({ name: name, reason: reason }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.deny_grant(::Google::Cloud::PrivilegedAccessManager::V1::DenyGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, deny_grant_client_stub.call_rpc_count - end - end - - def test_revoke_grant - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = "hello world" - - revoke_grant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :revoke_grant, name - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["reason"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, revoke_grant_client_stub do - # Create client - client = ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.revoke_grant({ name: name, reason: reason }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.revoke_grant name: name, reason: reason do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.revoke_grant ::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.revoke_grant({ name: name, reason: reason }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.revoke_grant(::Google::Cloud::PrivilegedAccessManager::V1::RevokeGrantRequest.new(name: name, reason: reason), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, revoke_grant_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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-privileged_access_manager-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.gitignore b/owl-bot-staging/google-cloud-privileged_access_manager/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.repo-metadata.json b/owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json deleted file mode 100644 index ba753b02c55d..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "privilegedaccessmanager.googleapis.com", - "api_shortname": "privilegedaccessmanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager/latest", - "distribution_name": "google-cloud-privileged_access_manager", - "is_cloud": true, - "language": "ruby", - "name": "privilegedaccessmanager", - "name_pretty": "Privileged Access Manager API", - "product_documentation": "https://cloud.google.com/iam/docs/pam-overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes.", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/pam-overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml b/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml deleted file mode 100644 index 00b61d8dae1e..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-privileged_access_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-privileged_access_manager.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb b/owl-bot-staging/google-cloud-privileged_access_manager/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/.yardopts b/owl-bot-staging/google-cloud-privileged_access_manager/.yardopts deleted file mode 100644 index 91c776c614b4..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Privileged Access 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-privileged_access_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md deleted file mode 100644 index 594d59bdf252..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager" - -client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/privileged_access_manager" - -Google::Cloud::PrivilegedAccessManager.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::PrivilegedAccessManager.privileged_access_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-privileged_access_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/privileged_access_manager" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::PrivilegedAccessManager.privileged_access_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-privileged_access_manager/CHANGELOG.md b/owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile b/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile deleted file mode 100644 index 59d2c5705f44..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-privileged_access_manager-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-privileged_access_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-privileged_access_manager/LICENSE.md b/owl-bot-staging/google-cloud-privileged_access_manager/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_manager/README.md b/owl-bot-staging/google-cloud-privileged_access_manager/README.md deleted file mode 100644 index bec43cab7e2f..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/README.md +++ /dev/null @@ -1,189 +0,0 @@ -# Ruby Client for the Privileged Access Manager API - -Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more. - -## Overview - -Privileged Access Manager (PAM) is a Google Cloud native, managed solution -to secure, manage and audit privileged access while ensuring operational -velocity and developer productivity. - -PAM enables just-in-time, time-bound, approval-based access elevations, -and auditing of privileged access elevations and activity. PAM lets you -define the rules of who can request access, what they can request access -to, and if they should be granted access with or without approvals based -on the sensitivity of the access and emergency of the situation. - -## Concepts - -### Entitlement - -An entitlement is an eligibility or license that allows specified users -(requesters) to request and obtain access to specified resources subject -to a set of conditions such as duration, etc. entitlements can be granted -to both human and non-human principals. - -### Grant - -A grant is an instance of active usage against the entitlement. A user can -place a request for a grant against an entitlement. The request may be -forwarded to an approver for their decision. Once approved, the grant is -activated, ultimately giving the user access (roles/permissions) on a -resource per the criteria specified in entitlement. - -### How does PAM work - -PAM creates and uses a service agent (Google-managed service account) to -perform the required IAM policy changes for granting access at a -specific -resource/access scope. The service agent requires getIAMPolicy and -setIAMPolicy permissions at the appropriate (or higher) access scope -- -Organization/Folder/Project to make policy changes on the resources listed -in PAM entitlements. - -When enabling PAM for a resource scope, the user/ principal performing -that action should have the appropriate permissions at that resource -scope -(resourcemanager.\\{projects|folders|organizations}.setIamPolicy, -resourcemanager.\\{projects|folders|organizations}.getIamPolicy, and -resourcemanager.\\{projects|folders|organizations}.get) to list and grant -the service agent/account the required access to perform IAM policy -changes. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-privileged_access_manager-v*`. -The gem `google-cloud-privileged_access_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-privileged_access_manager/latest) -for this library, google-cloud-privileged_access_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-privileged_access_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/iam/docs/pam-overview) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-privileged_access_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/privilegedaccessmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/privileged_access_manager" - -client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager -request = ::Google::Cloud::PrivilegedAccessManager::V1::CheckOnboardingStatusRequest.new # (request fields as keyword arguments...) -response = client.check_onboarding_status 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-privileged_access_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_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-privileged_access_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager/Rakefile b/owl-bot-staging/google-cloud-privileged_access_manager/Rakefile deleted file mode 100644 index f085f08dbafc..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-privileged_access_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/privileged_access_manager/v1/privileged_access_manager/credentials" - ::Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::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-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-privileged_access_manager" - header "google-cloud-privileged_access_manager rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-privileged_access_manager yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-privileged_access_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-privileged_access_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-privileged_access_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-privileged_access_manager/google-cloud-privileged_access_manager.gemspec b/owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec deleted file mode 100644 index ce7be40d79f2..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/google-cloud-privileged_access_manager.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/privileged_access_manager/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-privileged_access_manager" - gem.version = Google::Cloud::PrivilegedAccessManager::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "## Overview Privileged Access Manager (PAM) is a Google Cloud native, managed solution to secure, manage and audit privileged access while ensuring operational velocity and developer productivity. PAM enables just-in-time, time-bound, approval-based access elevations, and auditing of privileged access elevations and activity. PAM lets you define the rules of who can request access, what they can request access to, and if they should be granted access with or without approvals based on the sensitivity of the access and emergency of the situation. ## Concepts ### Entitlement An entitlement is an eligibility or license that allows specified users (requesters) to request and obtain access to specified resources subject to a set of conditions such as duration, etc. entitlements can be granted to both human and non-human principals. ### Grant A grant is an instance of active usage against the entitlement. A user can place a request for a grant against an entitlement. The request may be forwarded to an approver for their decision. Once approved, the grant is activated, ultimately giving the user access (roles/permissions) on a resource per the criteria specified in entitlement. ### How does PAM work PAM creates and uses a service agent (Google-managed service account) to perform the required IAM policy changes for granting access at a specific resource/access scope. The service agent requires getIAMPolicy and setIAMPolicy permissions at the appropriate (or higher) access scope - Organization/Folder/Project to make policy changes on the resources listed in PAM entitlements. When enabling PAM for a resource scope, the user/ principal performing that action should have the appropriate permissions at that resource scope (resourcemanager.{projects|folders|organizations}.setIamPolicy, resourcemanager.{projects|folders|organizations}.getIamPolicy, and resourcemanager.{projects|folders|organizations}.get) to list and grant the service agent/account the required access to perform IAM policy changes." - gem.summary = "Privileged Access Manager (PAM) helps you on your journey towards least privilege and helps mitigate risks tied to privileged access misuse or abuse. PAM allows you to shift from always-on standing privileges towards on-demand access with just-in-time, time-bound, and approval-based access elevations. PAM allows IAM administrators to create entitlements that can grant just-in-time, temporary access to any resource scope. Requesters can explore eligible entitlements and request the access needed for their task. Approvers are notified when approvals await their decision. Streamlined workflows facilitated by using PAM can support various use cases, including emergency access for incident responders, time-boxed access for developers for critical deployment or maintenance, temporary access for operators for data ingestion and audits, JIT access to service accounts for automated tasks, and more." - 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-privileged_access_manager-v1", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_manager.rb deleted file mode 100644 index 101eae8872a6..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google-cloud-privileged_access_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/privileged_access_manager" unless defined? Google::Cloud::PrivilegedAccessManager::VERSION diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb deleted file mode 100644 index 6f7f6f005ff3..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager.rb +++ /dev/null @@ -1,175 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/privileged_access_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! :privileged_access_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 PrivilegedAccessManager - ## - # Create a new client object for PrivilegedAccessManager. - # - # By default, this returns an instance of - # [Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-privileged_access_manager-v1/latest/Google-Cloud-PrivilegedAccessManager-V1-PrivilegedAccessManager-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 PrivilegedAccessManager 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 PrivilegedAccessManager service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::PrivilegedAccessManager.privileged_access_manager_available?}. - # - # ## About PrivilegedAccessManager - # - # This API allows customers to manage temporary, request based privileged - # access to their resources. - # - # It defines the following resource model: - # - # * A collection of `Entitlement` resources. An entitlement allows configuring - # (among other things): - # - # * Some kind of privileged access that users can request. - # * A set of users called _requesters_ who can request this access. - # * A maximum duration for which the access can be requested. - # * An optional approval workflow which must be satisfied before access is - # granted. - # - # * A collection of `Grant` resources. A grant is a request by a requester to - # get the privileged access specified in an entitlement for some duration. - # - # After the approval workflow as specified in the entitlement is satisfied, - # the specified access is given to the requester. The access is automatically - # taken back after the requested duration is over. - # - # @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.privileged_access_manager version: :v1, transport: :grpc, &block - require "google/cloud/privileged_access_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::PrivilegedAccessManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::PrivilegedAccessManager.const_get(package_name).const_get(:PrivilegedAccessManager) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PrivilegedAccessManager service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::PrivilegedAccessManager.privileged_access_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 PrivilegedAccessManager service, - # or if the versioned client gem needs an update to support the PrivilegedAccessManager 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.privileged_access_manager_available? version: :v1, transport: :grpc - require "google/cloud/privileged_access_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::PrivilegedAccessManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::PrivilegedAccessManager.const_get package_name - return false unless service_module.const_defined? :PrivilegedAccessManager - service_module = service_module.const_get :PrivilegedAccessManager - 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-privileged_access_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.privileged_access_manager if block_given? - - ::Google::Cloud.configure.privileged_access_manager - end - end - end -end - -helper_path = ::File.join __dir__, "privileged_access_manager", "helpers.rb" -require "google/cloud/privileged_access_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb b/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_manager/version.rb deleted file mode 100644 index ff72472c9bc6..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/lib/google/cloud/privileged_access_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 PrivilegedAccessManager - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/client_test.rb deleted file mode 100644 index 6124c5137dbf..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_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/privileged_access_manager" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::PrivilegedAccessManager::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_privileged_access_manager_grpc - skip unless Google::Cloud::PrivilegedAccessManager.privileged_access_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::PrivilegedAccessManager.privileged_access_manager transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Client, client - end - end - - def test_privileged_access_manager_rest - skip unless Google::Cloud::PrivilegedAccessManager.privileged_access_manager_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::PrivilegedAccessManager.privileged_access_manager transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::PrivilegedAccessManager::V1::PrivilegedAccessManager::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_manager/version_test.rb deleted file mode 100644 index d7eb89102b75..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_manager/test/google/cloud/privileged_access_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/privileged_access_manager/version" - -class Google::Cloud::PrivilegedAccessManager::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::PrivilegedAccessManager::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb b/owl-bot-staging/google-cloud-privileged_access_manager/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-privileged_access_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-profiler-v2/.gitignore b/owl-bot-staging/google-cloud-profiler-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json deleted file mode 100644 index 000104226eed..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudprofiler.googleapis.com", - "api_shortname": "cloudprofiler", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest", - "distribution_name": "google-cloud-profiler-v2", - "is_cloud": true, - "language": "ruby", - "name": "cloudprofiler", - "name_pretty": "Cloud Profiler V2 API", - "product_documentation": "https://cloud.google.com/profiler/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. Note that google-cloud-profiler-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-profiler instead. See the readme for more details.", - "ruby-cloud-env-prefix": "PROFILER", - "ruby-cloud-product-url": "https://cloud.google.com/profiler/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml b/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml deleted file mode 100644 index ffdeb25bb180..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-profiler-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-profiler-v2.rb" diff --git a/owl-bot-staging/google-cloud-profiler-v2/.toys.rb b/owl-bot-staging/google-cloud-profiler-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/.yardopts b/owl-bot-staging/google-cloud-profiler-v2/.yardopts deleted file mode 100644 index 021b712dcf35..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Profiler 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-profiler-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md deleted file mode 100644 index 40dc860dfd73..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-profiler-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-profiler-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/profiler/v2" - -client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/profiler/v2" - -::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler-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/profiler/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-profiler-v2/Gemfile b/owl-bot-staging/google-cloud-profiler-v2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/LICENSE.md b/owl-bot-staging/google-cloud-profiler-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/README.md b/owl-bot-staging/google-cloud-profiler-v2/README.md deleted file mode 100644 index b92d74e92ca8..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Profiler V2 API - -Manages continuous profiling information. - -Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. - -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 Profiler V2 API. Most users should consider using -the main client gem, -[google-cloud-profiler](https://rubygems.org/gems/google-cloud-profiler). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-profiler-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/cloudprofiler.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/profiler/v2" - -client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new -request = ::Google::Cloud::Profiler::V2::CreateProfileRequest.new # (request fields as keyword arguments...) -response = client.create_profile request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/profiler/docs) -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/profiler/v2" -require "logger" - -client = ::Google::Cloud::Profiler::V2::ProfilerService::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-profiler`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-profiler-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-profiler`. -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-profiler-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-profiler-v2/Rakefile b/owl-bot-staging/google-cloud-profiler-v2/Rakefile deleted file mode 100644 index 7f819b8aa2d6..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PROFILER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PROFILER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PROFILER_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 PROFILER_TEST_PROJECT=test123 PROFILER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/profiler/v2/profiler_service/credentials" - ::Google::Cloud::Profiler::V2::ProfilerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PROFILER_PROJECT"] = project - ENV["PROFILER_TEST_PROJECT"] = project - ENV["PROFILER_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-profiler-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-profiler-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-profiler-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-profiler-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-profiler-v2" - header "google-cloud-profiler-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-profiler-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-profiler-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-profiler-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-profiler-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-profiler-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json deleted file mode 100644 index 310894826f49..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.devtools.cloudprofiler.v2", - "libraryPackage": "::Google::Cloud::Profiler::V2", - "services": { - "ProfilerService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Profiler::V2::ProfilerService::Client", - "rpcs": { - "CreateProfile": { - "methods": [ - "create_profile" - ] - }, - "CreateOfflineProfile": { - "methods": [ - "create_offline_profile" - ] - }, - "UpdateProfile": { - "methods": [ - "update_profile" - ] - } - } - } - } - }, - "ExportService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Profiler::V2::ExportService::Client", - "rpcs": { - "ListProfiles": { - "methods": [ - "list_profiles" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec b/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec deleted file mode 100644 index 92f4f65bf935..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/google-cloud-profiler-v2.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/profiler/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-profiler-v2" - gem.version = Google::Cloud::Profiler::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. Note that google-cloud-profiler-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-profiler instead. See the readme for more details." - gem.summary = "Manages continuous profiling information." - 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-profiler-v2/lib/google-cloud-profiler-v2.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-v2.rb deleted file mode 100644 index 9231c126bfc1..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google-cloud-profiler-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/profiler/v2" diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb deleted file mode 100644 index 6352136f4a54..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/profiler/v2/profiler_service" -require "google/cloud/profiler/v2/export_service" -require "google/cloud/profiler/v2/version" - -module Google - module Cloud - module Profiler - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/profiler/v2" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/profiler/v2" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/profiler/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service.rb deleted file mode 100644 index 1bac0a61fb18..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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/profiler/v2/version" - -require "google/cloud/profiler/v2/export_service/credentials" -require "google/cloud/profiler/v2/export_service/paths" -require "google/cloud/profiler/v2/export_service/client" -require "google/cloud/profiler/v2/export_service/rest" - -module Google - module Cloud - module Profiler - module V2 - ## - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/profiler/v2/export_service" - # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/profiler/v2/export_service/rest" - # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new - # - module ExportService - end - end - end - end -end - -helper_path = ::File.join __dir__, "export_service", "helpers.rb" -require "google/cloud/profiler/v2/export_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb deleted file mode 100644 index 93d108509bf6..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/client.rb +++ /dev/null @@ -1,496 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/devtools/cloudprofiler/v2/profiler_pb" - -module Google - module Cloud - module Profiler - module V2 - module ExportService - ## - # Client for the ExportService service. - # - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :export_service_stub - - ## - # Configure the ExportService Client class. - # - # See {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ExportService clients - # ::Google::Cloud::Profiler::V2::ExportService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Profiler", "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 = 130.0 - default_config.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 ExportService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @export_service_stub.universe_domain - end - - ## - # Create a new ExportService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ExportService 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/devtools/cloudprofiler/v2/profiler_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 - - @export_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Profiler::V2::ExportService::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 - ) - - @export_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @export_service_stub.logger - end - - # Service calls - - ## - # Lists profiles which have been collected so far and for which the caller - # has permission to view. - # - # @overload list_profiles(request, options = nil) - # Pass arguments to `list_profiles` via a request object, either of type - # {::Google::Cloud::Profiler::V2::ListProfilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_profiles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_profiles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of profiles. - # Format: projects/\\{user_project_id} - # @param page_size [::Integer] - # The maximum number of items to return. - # Default page_size is 1000. - # Max limit is 1000. - # @param page_token [::String] - # The token to continue pagination and get profiles from a particular page. - # When paginating, all other parameters provided to `ListProfiles` must match - # the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ExportService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::ListProfilesRequest.new - # - # # Call the list_profiles method. - # result = client.list_profiles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Profiler::V2::Profile. - # p item - # end - # - def list_profiles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::ListProfilesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_profiles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_profiles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_profiles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @export_service_stub.call_rpc :list_profiles, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @export_service_stub, :list_profiles, request, response, 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 ExportService API. - # - # This class represents the configuration for ExportService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Profiler::V2::ExportService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_profiles to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Profiler::V2::ExportService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_profiles.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_profiles.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::Profiler::V2::ExportService::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 = "cloudprofiler.googleapis.com" - - config_attr :endpoint, nil, ::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 ExportService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_profiles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_profiles - - # @private - def initialize parent_rpcs = nil - list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles - @list_profiles = ::Gapic::Config::Method.new list_profiles_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/credentials.rb deleted file mode 100644 index 74121d4876e9..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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 Profiler - module V2 - module ExportService - # Credentials for the ExportService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.write" - ] - self.env_vars = [ - "PROFILER_CREDENTIALS", - "PROFILER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PROFILER_CREDENTIALS_JSON", - "PROFILER_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-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/paths.rb deleted file mode 100644 index 9eeb61a4ab75..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/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 Profiler - module V2 - module ExportService - # Path helper methods for the ExportService 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-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest.rb deleted file mode 100644 index 6cc46d261d73..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_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/profiler/v2/version" - -require "google/cloud/profiler/v2/export_service/credentials" -require "google/cloud/profiler/v2/export_service/paths" -require "google/cloud/profiler/v2/export_service/rest/client" - -module Google - module Cloud - module Profiler - module V2 - ## - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/profiler/v2/export_service/rest" - # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new - # - module ExportService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/profiler/v2/export_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb deleted file mode 100644 index 0e577b286170..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/client.rb +++ /dev/null @@ -1,446 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/export_service/rest/service_stub" - -module Google - module Cloud - module Profiler - module V2 - module ExportService - module Rest - ## - # REST client for the ExportService service. - # - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :export_service_stub - - ## - # Configure the ExportService Client class. - # - # See {::Google::Cloud::Profiler::V2::ExportService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ExportService clients - # ::Google::Cloud::Profiler::V2::ExportService::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", "Profiler", "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 = 130.0 - default_config.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 ExportService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Profiler::V2::ExportService::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 - @export_service_stub.universe_domain - end - - ## - # Create a new ExportService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ExportService 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 - - @export_service_stub = ::Google::Cloud::Profiler::V2::ExportService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @export_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @export_service_stub.logger - end - - # Service calls - - ## - # Lists profiles which have been collected so far and for which the caller - # has permission to view. - # - # @overload list_profiles(request, options = nil) - # Pass arguments to `list_profiles` via a request object, either of type - # {::Google::Cloud::Profiler::V2::ListProfilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_profiles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_profiles` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of profiles. - # Format: projects/\\{user_project_id} - # @param page_size [::Integer] - # The maximum number of items to return. - # Default page_size is 1000. - # Max limit is 1000. - # @param page_token [::String] - # The token to continue pagination and get profiles from a particular page. - # When paginating, all other parameters provided to `ListProfiles` must match - # the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ExportService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::ListProfilesRequest.new - # - # # Call the list_profiles method. - # result = client.list_profiles request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Profiler::V2::Profile. - # p item - # end - # - def list_profiles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::ListProfilesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_profiles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_profiles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_profiles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @export_service_stub.list_profiles request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @export_service_stub, :list_profiles, "profiles", request, result, 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 ExportService REST API. - # - # This class represents the configuration for ExportService 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::Profiler::V2::ExportService::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_profiles to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_profiles.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_profiles.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "cloudprofiler.googleapis.com" - - config_attr :endpoint, nil, ::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 ExportService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_profiles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_profiles - - # @private - def initialize parent_rpcs = nil - list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles - @list_profiles = ::Gapic::Config::Method.new list_profiles_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb deleted file mode 100644 index 9527d8e9cc3d..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/devtools/cloudprofiler/v2/profiler_pb" - -module Google - module Cloud - module Profiler - module V2 - module ExportService - module Rest - ## - # REST service stub for the ExportService 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_profiles REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::ListProfilesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::ListProfilesResponse] - # A result object deserialized from the server's reply - def list_profiles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_profiles_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_profiles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Profiler::V2::ListProfilesResponse.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_profiles REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_profiles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/profiles", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service.rb deleted file mode 100644 index 9105a1cd1ea3..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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/profiler/v2/version" - -require "google/cloud/profiler/v2/profiler_service/credentials" -require "google/cloud/profiler/v2/profiler_service/paths" -require "google/cloud/profiler/v2/profiler_service/client" -require "google/cloud/profiler/v2/profiler_service/rest" - -module Google - module Cloud - module Profiler - module V2 - ## - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/profiler/v2/profiler_service" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/profiler/v2/profiler_service/rest" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - module ProfilerService - end - end - end - end -end - -helper_path = ::File.join __dir__, "profiler_service", "helpers.rb" -require "google/cloud/profiler/v2/profiler_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb deleted file mode 100644 index b4c2aa671fed..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/client.rb +++ /dev/null @@ -1,716 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/devtools/cloudprofiler/v2/profiler_pb" - -module Google - module Cloud - module Profiler - module V2 - module ProfilerService - ## - # Client for the ProfilerService service. - # - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :profiler_service_stub - - ## - # Configure the ProfilerService Client class. - # - # See {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProfilerService clients - # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Profiler", "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: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_profile.timeout = 3610.0 - - default_config.rpcs.create_offline_profile.timeout = 30.0 - - default_config.rpcs.update_profile.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProfilerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @profiler_service_stub.universe_domain - end - - ## - # Create a new ProfilerService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProfilerService 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/devtools/cloudprofiler/v2/profiler_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 - - @profiler_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Profiler::V2::ProfilerService::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 - ) - - @profiler_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @profiler_service_stub.logger - end - - # Service calls - - ## - # CreateProfile creates a new profile resource in the online mode. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # The server ensures that the new profiles are created at a constant rate per - # deployment, so the creation request may hang for some time until the next - # profile session is available. - # - # The request may fail with ABORTED error if the creation is not available - # within ~1m, the response will indicate the duration of the backoff the - # client should take before attempting creating a profile again. The backoff - # duration is returned in google.rpc.RetryInfo extension on the response - # status. To a gRPC client, the extension will be return as a - # binary-serialized proto in the trailing metadata item named - # "google.rpc.retryinfo-bin". - # - # @overload create_profile(request, options = nil) - # Pass arguments to `create_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::CreateProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_profile(parent: nil, deployment: nil, profile_type: nil) - # Pass arguments to `create_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent project to create the profile in. - # @param deployment [::Google::Cloud::Profiler::V2::Deployment, ::Hash] - # Deployment details. - # @param profile_type [::Array<::Google::Cloud::Profiler::V2::ProfileType>] - # One or more profile types that the agent is capable of providing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new - # - # # Call the create_profile method. - # result = client.create_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def create_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.call_rpc :create_profile, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # CreateOfflineProfile creates a new profile resource in the offline - # mode. The client provides the profile to create along with the profile - # bytes, the server records it. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # @overload create_offline_profile(request, options = nil) - # Pass arguments to `create_offline_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_offline_profile(parent: nil, profile: nil) - # Pass arguments to `create_offline_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent project to create the profile in. - # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] - # Contents of the profile to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new - # - # # Call the create_offline_profile method. - # result = client.create_offline_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def create_offline_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest - - # Converts hash and nil to 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_offline_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_offline_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_offline_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.call_rpc :create_offline_profile, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # UpdateProfile updates the profile bytes and labels on the profile resource - # created in the online mode. Updating the bytes for profiles created in the - # offline mode is currently not supported: the profile content must be - # provided at the time of the profile creation. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # @overload update_profile(request, options = nil) - # Pass arguments to `update_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::UpdateProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_profile(profile: nil, update_mask: nil) - # Pass arguments to `update_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] - # Profile to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask used to specify the fields to be overwritten. Currently only - # profile_bytes and labels fields are supported by UpdateProfile, so only - # those fields can be specified in the mask. When no mask is provided, all - # fields are overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new - # - # # Call the update_profile method. - # result = client.update_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def update_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::UpdateProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.profile&.name - header_params["profile.name"] = request.profile.name - end - - request_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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.call_rpc :update_profile, request, 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 ProfilerService API. - # - # This class represents the configuration for ProfilerService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Profiler::V2::ProfilerService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_profile to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Profiler::V2::ProfilerService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_profile.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_profile.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::Profiler::V2::ProfilerService::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 = "cloudprofiler.googleapis.com" - - config_attr :endpoint, nil, ::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 ProfilerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_profile - ## - # RPC-specific configuration for `create_offline_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_offline_profile - ## - # RPC-specific configuration for `update_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :update_profile - - # @private - def initialize parent_rpcs = nil - create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile - @create_profile = ::Gapic::Config::Method.new create_profile_config - create_offline_profile_config = parent_rpcs.create_offline_profile if parent_rpcs.respond_to? :create_offline_profile - @create_offline_profile = ::Gapic::Config::Method.new create_offline_profile_config - update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile - @update_profile = ::Gapic::Config::Method.new update_profile_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/credentials.rb deleted file mode 100644 index d125dc8dfc4c..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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 Profiler - module V2 - module ProfilerService - # Credentials for the ProfilerService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.write" - ] - self.env_vars = [ - "PROFILER_CREDENTIALS", - "PROFILER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PROFILER_CREDENTIALS_JSON", - "PROFILER_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-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/paths.rb deleted file mode 100644 index 8300f672e7c4..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/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 Profiler - module V2 - module ProfilerService - # Path helper methods for the ProfilerService API. - module Paths - ## - # Create a fully-qualified Profile resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/profiles/{profile}` - # - # @param project [String] - # @param profile [String] - # - # @return [::String] - def profile_path project:, profile: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/profiles/#{profile}" - 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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest.rb deleted file mode 100644 index 43e0389fc4e4..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_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/profiler/v2/version" - -require "google/cloud/profiler/v2/profiler_service/credentials" -require "google/cloud/profiler/v2/profiler_service/paths" -require "google/cloud/profiler/v2/profiler_service/rest/client" - -module Google - module Cloud - module Profiler - module V2 - ## - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/profiler/v2/profiler_service/rest" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - module ProfilerService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/profiler/v2/profiler_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb deleted file mode 100644 index 42d6c4dd2589..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb +++ /dev/null @@ -1,652 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/profiler_service/rest/service_stub" - -module Google - module Cloud - module Profiler - module V2 - module ProfilerService - module Rest - ## - # REST client for the ProfilerService service. - # - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :profiler_service_stub - - ## - # Configure the ProfilerService Client class. - # - # See {::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProfilerService clients - # ::Google::Cloud::Profiler::V2::ProfilerService::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", "Profiler", "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: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_profile.timeout = 3610.0 - - default_config.rpcs.create_offline_profile.timeout = 30.0 - - default_config.rpcs.update_profile.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProfilerService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Profiler::V2::ProfilerService::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 - @profiler_service_stub.universe_domain - end - - ## - # Create a new ProfilerService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProfilerService 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 - - @profiler_service_stub = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @profiler_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @profiler_service_stub.logger - end - - # Service calls - - ## - # CreateProfile creates a new profile resource in the online mode. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # The server ensures that the new profiles are created at a constant rate per - # deployment, so the creation request may hang for some time until the next - # profile session is available. - # - # The request may fail with ABORTED error if the creation is not available - # within ~1m, the response will indicate the duration of the backoff the - # client should take before attempting creating a profile again. The backoff - # duration is returned in google.rpc.RetryInfo extension on the response - # status. To a gRPC client, the extension will be return as a - # binary-serialized proto in the trailing metadata item named - # "google.rpc.retryinfo-bin". - # - # @overload create_profile(request, options = nil) - # Pass arguments to `create_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::CreateProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_profile(parent: nil, deployment: nil, profile_type: nil) - # Pass arguments to `create_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent project to create the profile in. - # @param deployment [::Google::Cloud::Profiler::V2::Deployment, ::Hash] - # Deployment details. - # @param profile_type [::Array<::Google::Cloud::Profiler::V2::ProfileType>] - # One or more profile types that the agent is capable of providing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new - # - # # Call the create_profile method. - # result = client.create_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def create_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.create_profile request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # CreateOfflineProfile creates a new profile resource in the offline - # mode. The client provides the profile to create along with the profile - # bytes, the server records it. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # @overload create_offline_profile(request, options = nil) - # Pass arguments to `create_offline_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_offline_profile(parent: nil, profile: nil) - # Pass arguments to `create_offline_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent project to create the profile in. - # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] - # Contents of the profile to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new - # - # # Call the create_offline_profile method. - # result = client.create_offline_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def create_offline_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest - - # Converts hash and nil to an 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_offline_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_offline_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_offline_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.create_offline_profile request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # UpdateProfile updates the profile bytes and labels on the profile resource - # created in the online mode. Updating the bytes for profiles created in the - # offline mode is currently not supported: the profile content must be - # provided at the time of the profile creation. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # @overload update_profile(request, options = nil) - # Pass arguments to `update_profile` via a request object, either of type - # {::Google::Cloud::Profiler::V2::UpdateProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_profile(profile: nil, update_mask: nil) - # Pass arguments to `update_profile` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash] - # Profile to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask used to specify the fields to be overwritten. Currently only - # profile_bytes and labels fields are supported by UpdateProfile, so only - # those fields can be specified in the mask. When no mask is provided, all - # fields are overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/profiler/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new - # - # # Call the update_profile method. - # result = client.update_profile request - # - # # The returned object is of type Google::Cloud::Profiler::V2::Profile. - # p result - # - def update_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::UpdateProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Profiler::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @profiler_service_stub.update_profile request, 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 ProfilerService REST API. - # - # This class represents the configuration for ProfilerService 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::Profiler::V2::ProfilerService::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_profile to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_profile.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_profile.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "cloudprofiler.googleapis.com" - - config_attr :endpoint, nil, ::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 ProfilerService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_profile - ## - # RPC-specific configuration for `create_offline_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_offline_profile - ## - # RPC-specific configuration for `update_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :update_profile - - # @private - def initialize parent_rpcs = nil - create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile - @create_profile = ::Gapic::Config::Method.new create_profile_config - create_offline_profile_config = parent_rpcs.create_offline_profile if parent_rpcs.respond_to? :create_offline_profile - @create_offline_profile = ::Gapic::Config::Method.new create_offline_profile_config - update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile - @update_profile = ::Gapic::Config::Method.new update_profile_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb deleted file mode 100644 index 5ef06ad70490..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.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 "google/devtools/cloudprofiler/v2/profiler_pb" - -module Google - module Cloud - module Profiler - module V2 - module ProfilerService - module Rest - ## - # REST service stub for the ProfilerService 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_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::CreateProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # A result object deserialized from the server's reply - def create_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Profiler::V2::Profile.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_offline_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # A result object deserialized from the server's reply - def create_offline_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_offline_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_offline_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Profiler::V2::Profile.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_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::UpdateProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Profiler::V2::Profile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Profiler::V2::Profile] - # A result object deserialized from the server's reply - def update_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Profiler::V2::Profile.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_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::CreateProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/profiles", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_offline_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest] - # 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_offline_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/profiles:createOffline", - body: "profile", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_profile REST call - # - # @param request_pb [::Google::Cloud::Profiler::V2::UpdateProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{profile.name}", - body: "profile", - matches: [ - ["profile.name", %r{^projects/[^/]+/profiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/rest.rb deleted file mode 100644 index 35e832c85ba4..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/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/profiler/v2/profiler_service/rest" -require "google/cloud/profiler/v2/export_service/rest" -require "google/cloud/profiler/v2/version" - -module Google - module Cloud - module Profiler - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/profiler/v2/rest" - # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/version.rb deleted file mode 100644 index b46c1f8cb5ef..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/cloud/profiler/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 Profiler - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb deleted file mode 100644 index ee50197ebffc..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudprofiler/v2/profiler.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/protobuf/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/devtools/cloudprofiler/v2/profiler.proto\x12 google.devtools.cloudprofiler.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x01\n\x14\x43reateProfileRequest\x12@\n\x06parent\x18\x04 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12@\n\ndeployment\x18\x01 \x01(\x0b\x32,.google.devtools.cloudprofiler.v2.Deployment\x12\x43\n\x0cprofile_type\x18\x02 \x03(\x0e\x32-.google.devtools.cloudprofiler.v2.ProfileType\"\x9b\x01\n\x1b\x43reateOfflineProfileRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12:\n\x07profile\x18\x02 \x01(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\"\x83\x01\n\x14UpdateProfileRequest\x12:\n\x07profile\x18\x01 \x01(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xee\x03\n\x07Profile\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x43\n\x0cprofile_type\x18\x02 \x01(\x0e\x32-.google.devtools.cloudprofiler.v2.ProfileType\x12@\n\ndeployment\x18\x03 \x01(\x0b\x32,.google.devtools.cloudprofiler.v2.Deployment\x12+\n\x08\x64uration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\rprofile_bytes\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x04\x12J\n\x06labels\x18\x06 \x03(\x0b\x32\x35.google.devtools.cloudprofiler.v2.Profile.LabelsEntryB\x03\xe0\x41\x04\x12\x33\n\nstart_time\x18\x07 \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:P\xea\x41M\n$cloudprofiler.googleapis.com/Profile\x12%projects/{project}/profiles/{profile}\"\xa9\x01\n\nDeployment\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x0e\n\x06target\x18\x02 \x01(\t\x12H\n\x06labels\x18\x03 \x03(\x0b\x32\x38.google.devtools.cloudprofiler.v2.Deployment.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x81\x01\n\x13ListProfilesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x86\x01\n\x14ListProfilesResponse\x12;\n\x08profiles\x18\x01 \x03(\x0b\x32).google.devtools.cloudprofiler.v2.Profile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x18\n\x10skipped_profiles\x18\x03 \x01(\x05*\x84\x01\n\x0bProfileType\x12\x1c\n\x18PROFILE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x43PU\x10\x01\x12\x08\n\x04WALL\x10\x02\x12\x08\n\x04HEAP\x10\x03\x12\x0b\n\x07THREADS\x10\x04\x12\x0e\n\nCONTENTION\x10\x05\x12\r\n\tPEAK_HEAP\x10\x06\x12\x0e\n\nHEAP_ALLOC\x10\x07\x32\xfe\x05\n\x0fProfilerService\x12\x9f\x01\n\rCreateProfile\x12\x36.google.devtools.cloudprofiler.v2.CreateProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"+\x82\xd3\xe4\x93\x02%\" /v2/{parent=projects/*}/profiles:\x01*\x12\xd2\x01\n\x14\x43reateOfflineProfile\x12=.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"P\xda\x41\x0eparent,profile\x82\xd3\xe4\x93\x02\x39\"./v2/{parent=projects/*}/profiles:createOffline:\x07profile\x12\xc3\x01\n\rUpdateProfile\x12\x36.google.devtools.cloudprofiler.v2.UpdateProfileRequest\x1a).google.devtools.cloudprofiler.v2.Profile\"O\xda\x41\x13profile,update_mask\x82\xd3\xe4\x93\x02\x33\x32(/v2/{profile.name=projects/*/profiles/*}:\x07profile\x1a\xad\x01\xca\x41\x1c\x63loudprofiler.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.write2\xf2\x02\n\rExportService\x12\xb0\x01\n\x0cListProfiles\x12\x35.google.devtools.cloudprofiler.v2.ListProfilesRequest\x1a\x36.google.devtools.cloudprofiler.v2.ListProfilesResponse\"1\xda\x41\x06parent\x82\xd3\xe4\x93\x02\"\x12 /v2/{parent=projects/*}/profiles\x1a\xad\x01\xca\x41\x1c\x63loudprofiler.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.writeB\xd4\x01\n$com.google.devtools.cloudprofiler.v2B\rProfilerProtoP\x01ZGcloud.google.com/go/cloudprofiler/apiv2/cloudprofilerpb;cloudprofilerpb\xaa\x02\x18Google.Cloud.Profiler.V2\xca\x02\x18Google\\Cloud\\Profiler\\V2\xea\x02\x1bGoogle::Cloud::Profiler::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.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.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 Profiler - module V2 - CreateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.CreateProfileRequest").msgclass - CreateOfflineProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest").msgclass - UpdateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.UpdateProfileRequest").msgclass - Profile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.Profile").msgclass - Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.Deployment").msgclass - ListProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ListProfilesRequest").msgclass - ListProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ListProfilesResponse").msgclass - ProfileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudprofiler.v2.ProfileType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb b/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb deleted file mode 100644 index 13170530a7a9..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb +++ /dev/null @@ -1,104 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/devtools/cloudprofiler/v2/profiler.proto for package 'Google.Cloud.Profiler.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/devtools/cloudprofiler/v2/profiler_pb' - -module Google - module Cloud - module Profiler - module V2 - module ProfilerService - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.devtools.cloudprofiler.v2.ProfilerService' - - # CreateProfile creates a new profile resource in the online mode. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - # - # The server ensures that the new profiles are created at a constant rate per - # deployment, so the creation request may hang for some time until the next - # profile session is available. - # - # The request may fail with ABORTED error if the creation is not available - # within ~1m, the response will indicate the duration of the backoff the - # client should take before attempting creating a profile again. The backoff - # duration is returned in google.rpc.RetryInfo extension on the response - # status. To a gRPC client, the extension will be return as a - # binary-serialized proto in the trailing metadata item named - # "google.rpc.retryinfo-bin". - # - rpc :CreateProfile, ::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Google::Cloud::Profiler::V2::Profile - # CreateOfflineProfile creates a new profile resource in the offline - # mode. The client provides the profile to create along with the profile - # bytes, the server records it. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - rpc :CreateOfflineProfile, ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Google::Cloud::Profiler::V2::Profile - # UpdateProfile updates the profile bytes and labels on the profile resource - # created in the online mode. Updating the bytes for profiles created in the - # offline mode is currently not supported: the profile content must be - # provided at the time of the profile creation. - # - # _Direct use of this API is discouraged, please use a [supported - # profiler - # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) - # instead for profile collection._ - rpc :UpdateProfile, ::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Google::Cloud::Profiler::V2::Profile - end - - Stub = Service.rpc_stub_class - end - module ExportService - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.devtools.cloudprofiler.v2.ExportService' - - # Lists profiles which have been collected so far and for which the caller - # has permission to view. - rpc :ListProfiles, ::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Google::Cloud::Profiler::V2::ListProfilesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md deleted file mode 100644 index 94d3738b5a08..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Profiler 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-profiler-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb deleted file mode 100644 index e84a3616933c..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/devtools/cloudprofiler/v2/profiler.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 Profiler - module V2 - # CreateProfileRequest describes a profile resource online creation request. - # The deployment field must be populated. The profile_type specifies the list - # of profile types supported by the agent. The creation call will hang until a - # profile of one of these types needs to be collected. - # @!attribute [rw] parent - # @return [::String] - # Parent project to create the profile in. - # @!attribute [rw] deployment - # @return [::Google::Cloud::Profiler::V2::Deployment] - # Deployment details. - # @!attribute [rw] profile_type - # @return [::Array<::Google::Cloud::Profiler::V2::ProfileType>] - # One or more profile types that the agent is capable of providing. - class CreateProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreateOfflineProfileRequest describes a profile resource offline creation - # request. - # @!attribute [rw] parent - # @return [::String] - # Parent project to create the profile in. - # @!attribute [rw] profile - # @return [::Google::Cloud::Profiler::V2::Profile] - # Contents of the profile to create. - class CreateOfflineProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpdateProfileRequest contains the profile to update. - # @!attribute [rw] profile - # @return [::Google::Cloud::Profiler::V2::Profile] - # Profile to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask used to specify the fields to be overwritten. Currently only - # profile_bytes and labels fields are supported by UpdateProfile, so only - # those fields can be specified in the mask. When no mask is provided, all - # fields are overwritten. - class UpdateProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Profile resource. - # @!attribute [r] name - # @return [::String] - # Output only. Opaque, server-assigned, unique ID for this profile. - # @!attribute [rw] profile_type - # @return [::Google::Cloud::Profiler::V2::ProfileType] - # Type of profile. - # For offline mode, this must be specified when creating the profile. For - # online mode it is assigned and returned by the server. - # @!attribute [rw] deployment - # @return [::Google::Cloud::Profiler::V2::Deployment] - # Deployment this profile corresponds to. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration of the profiling session. - # Input (for the offline mode) or output (for the online mode). - # The field represents requested profiling duration. It may slightly differ - # from the effective profiling duration, which is recorded in the profile - # data, in case the profiling can't be stopped immediately (e.g. in case - # stopping the profiling is handled asynchronously). - # @!attribute [rw] profile_bytes - # @return [::String] - # Input only. Profile bytes, as a gzip compressed serialized proto, the - # format is https://github.com/google/pprof/blob/master/proto/profile.proto. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Input only. Labels associated to this specific profile. These labels will - # get merged with the deployment labels for the final data set. See - # documentation on deployment labels for validation rules and limits. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Start time for the profile. - # This output is only present in response from the ListProfiles method. - class Profile - 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 - - # Deployment contains the deployment identification information. - # @!attribute [rw] project_id - # @return [::String] - # Project ID is the ID of a cloud project. - # Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. - # @!attribute [rw] target - # @return [::String] - # Target is the service name used to group related deployments: - # * Service name for App Engine Flex / Standard. - # * Cluster and container name for GKE. - # * User-specified string for direct Compute Engine profiling (e.g. Java). - # * Job name for Dataflow. - # Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels identify the deployment within the user universe and same target. - # Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # Value for an individual label must be <= 512 bytes, the total - # size of all label names and values must be <= 1024 bytes. - # - # Label named "language" can be used to record the programming language of - # the profiled deployment. The standard choices for the value include "java", - # "go", "python", "ruby", "nodejs", "php", "dotnet". - # - # For deployments running on Google Cloud Platform, "zone" or "region" label - # should be present describing the deployment location. An example of a zone - # is "us-central1-a", an example of a region is "us-central1" or - # "us-central". - class Deployment - 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 - - # ListProfilesRequest contains request parameters for listing profiles for - # deployments in projects which the user has permissions to view. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of profiles. - # Format: projects/\\{user_project_id} - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # Default page_size is 1000. - # Max limit is 1000. - # @!attribute [rw] page_token - # @return [::String] - # The token to continue pagination and get profiles from a particular page. - # When paginating, all other parameters provided to `ListProfiles` must match - # the call that provided the page token. - class ListProfilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListProfileResponse contains the list of collected profiles for deployments - # in projects which the user has permissions to view. - # @!attribute [rw] profiles - # @return [::Array<::Google::Cloud::Profiler::V2::Profile>] - # List of profiles fetched. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to receive the next page of results. - # This field maybe empty if there are no more profiles to fetch. - # @!attribute [rw] skipped_profiles - # @return [::Integer] - # Number of profiles that were skipped in the current page since they were - # not able to be fetched successfully. This should typically be zero. A - # non-zero value may indicate a transient failure, in which case if the - # number is too high for your use case, the call may be retried. - class ListProfilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ProfileType is type of profiling data. - # NOTE: the enumeration member names are used (in lowercase) as unique string - # identifiers of profile types, so they must not be renamed. - module ProfileType - # Unspecified profile type. - PROFILE_TYPE_UNSPECIFIED = 0 - - # Thread CPU time sampling. - CPU = 1 - - # Wallclock time sampling. More expensive as stops all threads. - WALL = 2 - - # In-use heap profile. Represents a snapshot of the allocations that are - # live at the time of the profiling. - HEAP = 3 - - # Single-shot collection of all thread stacks. - THREADS = 4 - - # Synchronization contention profile. - CONTENTION = 5 - - # Peak heap profile. - PEAK_HEAP = 6 - - # Heap allocation profile. It represents the aggregation of all allocations - # made over the duration of the profile. All allocations are included, - # including those that might have been freed by the end of the profiling - # interval. The profile is in particular useful for garbage collecting - # languages to understand which parts of the code create most of the garbage - # collection pressure to see if those can be optimized. - HEAP_ALLOC = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-profiler-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-profiler-v2/snippets/Gemfile deleted file mode 100644 index cf6ec181be06..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler-v2", path: "../" -else - gem "google-cloud-profiler-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-profiler-v2/snippets/export_service/list_profiles.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.rb deleted file mode 100644 index dc35344789e5..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/snippets/export_service/list_profiles.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 cloudprofiler_v2_generated_ExportService_ListProfiles_sync] -require "google/cloud/profiler/v2" - -## -# Snippet for the list_profiles call in the ExportService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Profiler::V2::ExportService::Client#list_profiles. -# -def list_profiles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Profiler::V2::ExportService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Profiler::V2::ListProfilesRequest.new - - # Call the list_profiles method. - result = client.list_profiles request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Profiler::V2::Profile. - p item - end -end -# [END cloudprofiler_v2_generated_ExportService_ListProfiles_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb deleted file mode 100644 index 9c9dc21ec20a..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] -require "google/cloud/profiler/v2" - -## -# Snippet for the create_offline_profile call in the ProfilerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile. -# -def create_offline_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new - - # Call the create_offline_profile method. - result = client.create_offline_profile request - - # The returned object is of type Google::Cloud::Profiler::V2::Profile. - p result -end -# [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb deleted file mode 100644 index 54bbbe15c0f8..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] -require "google/cloud/profiler/v2" - -## -# Snippet for the create_profile call in the ProfilerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile. -# -def create_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Profiler::V2::CreateProfileRequest.new - - # Call the create_profile method. - result = client.create_profile request - - # The returned object is of type Google::Cloud::Profiler::V2::Profile. - p result -end -# [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb b/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb deleted file mode 100644 index b0bde777d839..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] -require "google/cloud/profiler/v2" - -## -# Snippet for the update_profile call in the ProfilerService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile. -# -def update_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Profiler::V2::ProfilerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new - - # Call the update_profile method. - result = client.update_profile request - - # The returned object is of type Google::Cloud::Profiler::V2::Profile. - p result -end -# [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json b/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json deleted file mode 100644 index 9060c42194ed..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-profiler-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.devtools.cloudprofiler.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync", - "title": "Snippet for the create_profile call in the ProfilerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile.", - "file": "profiler_service/create_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_profile", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Profiler::V2::CreateProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Profiler::V2::Profile", - "client": { - "short_name": "ProfilerService::Client", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" - }, - "method": { - "short_name": "CreateProfile", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile", - "service": { - "short_name": "ProfilerService", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync", - "title": "Snippet for the create_offline_profile call in the ProfilerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile.", - "file": "profiler_service/create_offline_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_offline_profile", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Profiler::V2::Profile", - "client": { - "short_name": "ProfilerService::Client", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" - }, - "method": { - "short_name": "CreateOfflineProfile", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile", - "service": { - "short_name": "ProfilerService", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync", - "title": "Snippet for the update_profile call in the ProfilerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile.", - "file": "profiler_service/update_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_profile", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Profiler::V2::UpdateProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Profiler::V2::Profile", - "client": { - "short_name": "ProfilerService::Client", - "full_name": "::Google::Cloud::Profiler::V2::ProfilerService::Client" - }, - "method": { - "short_name": "UpdateProfile", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile", - "service": { - "short_name": "ProfilerService", - "full_name": "google.devtools.cloudprofiler.v2.ProfilerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudprofiler_v2_generated_ExportService_ListProfiles_sync", - "title": "Snippet for the list_profiles call in the ExportService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Profiler::V2::ExportService::Client#list_profiles.", - "file": "export_service/list_profiles.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_profiles", - "full_name": "::Google::Cloud::Profiler::V2::ExportService::Client#list_profiles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Profiler::V2::ListProfilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Profiler::V2::ListProfilesResponse", - "client": { - "short_name": "ExportService::Client", - "full_name": "::Google::Cloud::Profiler::V2::ExportService::Client" - }, - "method": { - "short_name": "ListProfiles", - "full_name": "google.devtools.cloudprofiler.v2.ExportService.ListProfiles", - "service": { - "short_name": "ExportService", - "full_name": "google.devtools.cloudprofiler.v2.ExportService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb deleted file mode 100644 index 9dafe37c9e1c..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_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/profiler/v2/export_service" - -class ::Google::Cloud::Profiler::V2::ExportService::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::Profiler::V2::ExportService::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-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb deleted file mode 100644 index b18c1405d007..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_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/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/export_service/rest" - - -class ::Google::Cloud::Profiler::V2::ExportService::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_profiles - # Create test objects. - client_result = ::Google::Cloud::Profiler::V2::ListProfilesResponse.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_profiles_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Profiler::V2::ExportService::Rest::ServiceStub.stub :transcode_list_profiles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_profiles_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_profiles({ 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_profiles 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_profiles ::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles({ 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_profiles(::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles_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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb deleted file mode 100644 index 61b92489328d..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb +++ /dev/null @@ -1,171 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/export_service" - -class ::Google::Cloud::Profiler::V2::ExportService::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_profiles - # Create GRPC objects. - grpc_response = ::Google::Cloud::Profiler::V2::ListProfilesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_profiles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_profiles, name - assert_kind_of ::Google::Cloud::Profiler::V2::ListProfilesRequest, 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_profiles_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_profiles({ parent: parent, page_size: page_size, page_token: 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_profiles parent: parent, page_size: page_size, page_token: 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_profiles ::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles({ 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_profiles(::Google::Cloud::Profiler::V2::ListProfilesRequest.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_profiles_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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::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::Profiler::V2::ExportService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Profiler::V2::ExportService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb deleted file mode 100644 index f2b290d7bb87..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_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/profiler/v2/profiler_service" - -class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.profile_path project: "value0", profile: "value1" - assert_equal "projects/value0/profiles/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::Profiler::V2::ProfilerService::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-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb deleted file mode 100644 index dcd59318b9d2..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.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 "helper" -require "gapic/rest" -require "google/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/profiler_service/rest" - - -class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile - # Create test objects. - client_result = ::Google::Cloud::Profiler::V2::Profile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - deployment = {} - profile_type = [:PROFILE_TYPE_UNSPECIFIED] - - create_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_create_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_profile parent: parent, deployment: deployment, profile_type: profile_type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_profile ::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_profile(::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_profile_client_stub.call_count - end - end - end - - def test_create_offline_profile - # Create test objects. - client_result = ::Google::Cloud::Profiler::V2::Profile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - profile = {} - - create_offline_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_create_offline_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_offline_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_offline_profile({ parent: parent, profile: profile }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_offline_profile parent: parent, profile: profile do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_offline_profile ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_offline_profile({ parent: parent, profile: profile }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_offline_profile(::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_offline_profile_client_stub.call_count - end - end - end - - def test_update_profile - # Create test objects. - client_result = ::Google::Cloud::Profiler::V2::Profile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - profile = {} - update_mask = {} - - update_profile_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.stub :transcode_update_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_profile({ profile: profile, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_profile profile: profile, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_profile ::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_profile({ profile: profile, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_profile(::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_profile_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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb b/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb deleted file mode 100644 index bf5990b988ce..000000000000 --- a/owl-bot-staging/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb +++ /dev/null @@ -1,286 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/devtools/cloudprofiler/v2/profiler_pb" -require "google/cloud/profiler/v2/profiler_service" - -class ::Google::Cloud::Profiler::V2::ProfilerService::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_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Profiler::V2::Profile.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - deployment = {} - profile_type = [:PROFILE_TYPE_UNSPECIFIED] - - create_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_profile, name - assert_kind_of ::Google::Cloud::Profiler::V2::CreateProfileRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Deployment), request["deployment"] - assert_equal [:PROFILE_TYPE_UNSPECIFIED], request["profile_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_profile parent: parent, deployment: deployment, profile_type: profile_type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_profile ::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_profile({ parent: parent, deployment: deployment, profile_type: profile_type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_profile(::Google::Cloud::Profiler::V2::CreateProfileRequest.new(parent: parent, deployment: deployment, profile_type: profile_type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_profile_client_stub.call_rpc_count - end - end - - def test_create_offline_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Profiler::V2::Profile.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - profile = {} - - create_offline_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_offline_profile, name - assert_kind_of ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Profile), request["profile"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_offline_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_offline_profile({ parent: parent, profile: profile }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_offline_profile parent: parent, profile: profile do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_offline_profile ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_offline_profile({ parent: parent, profile: profile }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_offline_profile(::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new(parent: parent, profile: profile), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_offline_profile_client_stub.call_rpc_count - end - end - - def test_update_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Profiler::V2::Profile.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - profile = {} - update_mask = {} - - update_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_profile, name - assert_kind_of ::Google::Cloud::Profiler::V2::UpdateProfileRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Profiler::V2::Profile), request["profile"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_profile_client_stub do - # Create client - client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_profile({ profile: profile, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_profile profile: profile, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_profile ::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, 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_profile({ profile: profile, 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_profile(::Google::Cloud::Profiler::V2::UpdateProfileRequest.new(profile: profile, 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_profile_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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::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::Profiler::V2::ProfilerService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Profiler::V2::ProfilerService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler-v2/test/helper.rb b/owl-bot-staging/google-cloud-profiler-v2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-profiler-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-profiler/.gitignore b/owl-bot-staging/google-cloud-profiler/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-profiler/.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-profiler/.repo-metadata.json b/owl-bot-staging/google-cloud-profiler/.repo-metadata.json deleted file mode 100644 index 2ea671bbe7dc..000000000000 --- a/owl-bot-staging/google-cloud-profiler/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudprofiler.googleapis.com", - "api_shortname": "cloudprofiler", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-profiler/latest", - "distribution_name": "google-cloud-profiler", - "is_cloud": true, - "language": "ruby", - "name": "cloudprofiler", - "name_pretty": "Cloud Profiler API", - "product_documentation": "https://cloud.google.com/profiler/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code.", - "ruby-cloud-env-prefix": "PROFILER", - "ruby-cloud-product-url": "https://cloud.google.com/profiler/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-profiler/.rubocop.yml b/owl-bot-staging/google-cloud-profiler/.rubocop.yml deleted file mode 100644 index 12806b0627ab..000000000000 --- a/owl-bot-staging/google-cloud-profiler/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-profiler.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-profiler.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-profiler/.toys.rb b/owl-bot-staging/google-cloud-profiler/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-profiler/.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-profiler/.yardopts b/owl-bot-staging/google-cloud-profiler/.yardopts deleted file mode 100644 index e4b95f189bd2..000000000000 --- a/owl-bot-staging/google-cloud-profiler/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Profiler 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-profiler/AUTHENTICATION.md b/owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md deleted file mode 100644 index 59121f2318c0..000000000000 --- a/owl-bot-staging/google-cloud-profiler/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-profiler 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-profiler 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/profiler" - -client = Google::Cloud::Profiler.profiler_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/profiler" - -Google::Cloud::Profiler.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Profiler.profiler_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-profiler -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/profiler" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Profiler.profiler_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-profiler/CHANGELOG.md b/owl-bot-staging/google-cloud-profiler/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-profiler/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-profiler/Gemfile b/owl-bot-staging/google-cloud-profiler/Gemfile deleted file mode 100644 index eebcef710b09..000000000000 --- a/owl-bot-staging/google-cloud-profiler/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-profiler-v2"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-profiler.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-profiler/LICENSE.md b/owl-bot-staging/google-cloud-profiler/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-profiler/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-profiler/README.md b/owl-bot-staging/google-cloud-profiler/README.md deleted file mode 100644 index 82318ee25c51..000000000000 --- a/owl-bot-staging/google-cloud-profiler/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Profiler API - -API Client library for the Cloud Profiler API - -Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-profiler-v*`. -The gem `google-cloud-profiler` 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-profiler/latest) -for this library, google-cloud-profiler, 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-profiler-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest). - -See also the [Product Documentation](https://cloud.google.com/profiler/docs) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-profiler -``` - -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/cloudprofiler.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/profiler" - -client = Google::Cloud::Profiler.profiler_service -request = ::Google::Cloud::Profiler::V2::CreateProfileRequest.new # (request fields as keyword arguments...) -response = client.create_profile 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-profiler-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-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-profiler`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-profiler-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-profiler`. -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-profiler-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-profiler/Rakefile b/owl-bot-staging/google-cloud-profiler/Rakefile deleted file mode 100644 index d5348d15ab40..000000000000 --- a/owl-bot-staging/google-cloud-profiler/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-profiler acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PROFILER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PROFILER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PROFILER_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 PROFILER_TEST_PROJECT=test123 PROFILER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/profiler/v2/profiler_service/credentials" - ::Google::Cloud::Profiler::V2::ProfilerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PROFILER_PROJECT"] = project - ENV["PROFILER_TEST_PROJECT"] = project - ENV["PROFILER_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-profiler 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-profiler 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-profiler 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-profiler gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-profiler" - header "google-cloud-profiler rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-profiler yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-profiler 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-profiler 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-profiler 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-profiler/google-cloud-profiler.gemspec b/owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec deleted file mode 100644 index a8814b82ab05..000000000000 --- a/owl-bot-staging/google-cloud-profiler/google-cloud-profiler.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/profiler/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-profiler" - gem.version = Google::Cloud::Profiler::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application's source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code." - gem.summary = "API Client library for the Cloud Profiler 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-profiler-v2", ">= 0.9", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb b/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.rb deleted file mode 100644 index 2aeff728ee34..000000000000 --- a/owl-bot-staging/google-cloud-profiler/lib/google-cloud-profiler.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/profiler" unless defined? Google::Cloud::Profiler::VERSION diff --git a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.rb deleted file mode 100644 index fda02531c480..000000000000 --- a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler.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! - -# 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/profiler/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! :profiler 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 Profiler - ## - # Create a new client object for ProfilerService. - # - # By default, this returns an instance of - # [Google::Cloud::Profiler::V2::ProfilerService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest/Google-Cloud-Profiler-V2-ProfilerService-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 ProfilerService 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 ProfilerService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Profiler.profiler_service_available?}. - # - # ## About ProfilerService - # - # Manage the collection of continuous profiling data provided by profiling - # agents running in the cloud or by an offline provider of profiling data. - # - # __The APIs listed in this service are intended for use within our profiler - # agents only.__ - # - # @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.profiler_service version: :v2, transport: :grpc, &block - require "google/cloud/profiler/#{version.to_s.downcase}" - - package_name = Google::Cloud::Profiler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Profiler.const_get(package_name).const_get(:ProfilerService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ProfilerService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.profiler_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 ProfilerService service, - # or if the versioned client gem needs an update to support the ProfilerService 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.profiler_service_available? version: :v2, transport: :grpc - require "google/cloud/profiler/#{version.to_s.downcase}" - package_name = Google::Cloud::Profiler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Profiler.const_get package_name - return false unless service_module.const_defined? :ProfilerService - service_module = service_module.const_get :ProfilerService - 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 ExportService. - # - # By default, this returns an instance of - # [Google::Cloud::Profiler::V2::ExportService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-profiler-v2/latest/Google-Cloud-Profiler-V2-ExportService-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 ExportService 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 ExportService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Profiler.export_service_available?}. - # - # ## About ExportService - # - # Service allows existing Cloud Profiler customers to export their profile data - # out of Google Cloud. - # - # @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.export_service version: :v2, transport: :grpc, &block - require "google/cloud/profiler/#{version.to_s.downcase}" - - package_name = Google::Cloud::Profiler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Profiler.const_get(package_name).const_get(:ExportService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ExportService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Profiler.export_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 ExportService service, - # or if the versioned client gem needs an update to support the ExportService 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.export_service_available? version: :v2, transport: :grpc - require "google/cloud/profiler/#{version.to_s.downcase}" - package_name = Google::Cloud::Profiler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Profiler.const_get package_name - return false unless service_module.const_defined? :ExportService - service_module = service_module.const_get :ExportService - 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-profiler 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.profiler if block_given? - - ::Google::Cloud.configure.profiler - end - end - end -end - -helper_path = ::File.join __dir__, "profiler", "helpers.rb" -require "google/cloud/profiler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb b/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/version.rb deleted file mode 100644 index ae845b29de7a..000000000000 --- a/owl-bot-staging/google-cloud-profiler/lib/google/cloud/profiler/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 Profiler - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/client_test.rb deleted file mode 100644 index e3a0d1dcc342..000000000000 --- a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/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/profiler" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Profiler::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_profiler_service_grpc - skip unless Google::Cloud::Profiler.profiler_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::Profiler.profiler_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Profiler::V2::ProfilerService::Client, client - end - end - - def test_profiler_service_rest - skip unless Google::Cloud::Profiler.profiler_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Profiler.profiler_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Profiler::V2::ProfilerService::Rest::Client, client - end - end - - def test_export_service_grpc - skip unless Google::Cloud::Profiler.export_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::Profiler.export_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Profiler::V2::ExportService::Client, client - end - end - - def test_export_service_rest - skip unless Google::Cloud::Profiler.export_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Profiler.export_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Profiler::V2::ExportService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb b/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/version_test.rb deleted file mode 100644 index 19e7626008b0..000000000000 --- a/owl-bot-staging/google-cloud-profiler/test/google/cloud/profiler/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/profiler/version" - -class Google::Cloud::Profiler::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Profiler::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-profiler/test/helper.rb b/owl-bot-staging/google-cloud-profiler/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-profiler/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-rapid_migration_assessment-v1/.gitignore b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json deleted file mode 100644 index 5a4a90dc723a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "rapidmigrationassessment.googleapis.com", - "api_shortname": "rapidmigrationassessment", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest", - "distribution_name": "google-cloud-rapid_migration_assessment-v1", - "is_cloud": true, - "language": "ruby", - "name": "rapidmigrationassessment", - "name_pretty": "Rapid Migration Assessment V1 API", - "product_documentation": "https://cloud.google.com/migration-center/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Rapid Migration Assessment service is our first-party migration assessment and planning tool. Note that google-cloud-rapid_migration_assessment-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-rapid_migration_assessment instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/migration-center/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml deleted file mode 100644 index 3fbe99c3b327..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1.rb" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/.yardopts b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts deleted file mode 100644 index 9caa2c86cf62..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Rapid Migration Assessment 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-rapid_migration_assessment-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md deleted file mode 100644 index 43687b3914bb..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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/rapid_migration_assessment/v1" - -client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/rapid_migration_assessment/v1" - -::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-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/rapid_migration_assessment/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/LICENSE.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md deleted file mode 100644 index 1cbb78311956..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Rapid Migration Assessment V1 API - -The Rapid Migration Assessment service is our first-party migration assessment and planning tool. - -The Rapid Migration Assessment service is our first-party migration assessment and planning tool. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Rapid Migration Assessment V1 API. Most users should consider using -the main client gem, -[google-cloud-rapid_migration_assessment](https://rubygems.org/gems/google-cloud-rapid_migration_assessment). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-rapid_migration_assessment-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/rapidmigrationassessment.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/rapid_migration_assessment/v1" - -client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new -request = ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new # (request fields as keyword arguments...) -response = client.create_collector request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/migration-center/docs) -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/rapid_migration_assessment/v1" -require "logger" - -client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`. -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-rapid_migration_assessment-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-rapid_migration_assessment-v1/Rakefile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/Rakefile deleted file mode 100644 index 8f543dc9c6d6..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-rapid_migration_assessment-v1" - header "google-cloud-rapid_migration_assessment-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-rapid_migration_assessment-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-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-rapid_migration_assessment-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json deleted file mode 100644 index 3201fa6c244a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/gapic_metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.rapidmigrationassessment.v1", - "libraryPackage": "::Google::Cloud::RapidMigrationAssessment::V1", - "services": { - "RapidMigrationAssessment": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client", - "rpcs": { - "CreateCollector": { - "methods": [ - "create_collector" - ] - }, - "CreateAnnotation": { - "methods": [ - "create_annotation" - ] - }, - "GetAnnotation": { - "methods": [ - "get_annotation" - ] - }, - "ListCollectors": { - "methods": [ - "list_collectors" - ] - }, - "GetCollector": { - "methods": [ - "get_collector" - ] - }, - "UpdateCollector": { - "methods": [ - "update_collector" - ] - }, - "DeleteCollector": { - "methods": [ - "delete_collector" - ] - }, - "ResumeCollector": { - "methods": [ - "resume_collector" - ] - }, - "RegisterCollector": { - "methods": [ - "register_collector" - ] - }, - "PauseCollector": { - "methods": [ - "pause_collector" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec deleted file mode 100644 index f463574e867d..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/google-cloud-rapid_migration_assessment-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/rapid_migration_assessment/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-rapid_migration_assessment-v1" - gem.version = Google::Cloud::RapidMigrationAssessment::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool. Note that google-cloud-rapid_migration_assessment-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-rapid_migration_assessment instead. See the readme for more details." - gem.summary = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." - 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-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-v1.rb deleted file mode 100644 index 3373fa07b8ef..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google-cloud-rapid_migration_assessment-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/rapid_migration_assessment/v1" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1.rb deleted file mode 100644 index 7d07419e40b5..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/v1/rapid_migration_assessment" -require "google/cloud/rapid_migration_assessment/v1/version" - -module Google - module Cloud - module RapidMigrationAssessment - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/rapid_migration_assessment/v1" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/rapid_migration_assessment/v1" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/rapid_migration_assessment/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb deleted file mode 100644 index 1ca77f0f295c..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/rapid_migration_assessment/v1/rest" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RapidMigrationAssessment"] - parent_config = while namespace.any? - parent_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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb deleted file mode 100644 index c3342b768ad7..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.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/rapid_migration_assessment/v1/version" - -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - ## - # Service describing handlers for resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - module RapidMigrationAssessment - end - end - end - end -end - -helper_path = ::File.join __dir__, "rapid_migration_assessment", "helpers.rb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb deleted file mode 100644 index 8c781eeb8cdd..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb +++ /dev/null @@ -1,1527 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" -require "google/cloud/location" - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - ## - # Client for the RapidMigrationAssessment service. - # - # Service describing handlers for resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :rapid_migration_assessment_stub - - ## - # Configure the RapidMigrationAssessment Client class. - # - # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RapidMigrationAssessment clients - # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RapidMigrationAssessment", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_collector.timeout = 60.0 - - default_config.rpcs.create_annotation.timeout = 60.0 - - default_config.rpcs.get_annotation.timeout = 60.0 - default_config.rpcs.get_annotation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_collectors.timeout = 60.0 - default_config.rpcs.list_collectors.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_collector.timeout = 60.0 - default_config.rpcs.get_collector.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_collector.timeout = 60.0 - - default_config.rpcs.delete_collector.timeout = 60.0 - - default_config.rpcs.resume_collector.timeout = 60.0 - - default_config.rpcs.register_collector.timeout = 60.0 - - default_config.rpcs.pause_collector.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RapidMigrationAssessment Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @rapid_migration_assessment_stub.universe_domain - end - - ## - # Create a new RapidMigrationAssessment client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RapidMigrationAssessment 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/rapidmigrationassessment/v1/rapidmigrationassessment_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 - - @rapid_migration_assessment_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 - ) - - @rapid_migration_assessment_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 = @rapid_migration_assessment_stub.endpoint - config.universe_domain = @rapid_migration_assessment_stub.universe_domain - config.logger = @rapid_migration_assessment_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 - @rapid_migration_assessment_stub.logger - end - - # Service calls - - ## - # Create a Collector to manage the on-prem appliance which collects - # information about Customer assets. - # - # @overload create_collector(request, options = nil) - # Pass arguments to `create_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil) - # Pass arguments to `create_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent (project+location). - # @param collector_id [::String] - # Required. Id of the requesting object. - # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new - # - # # Call the create_collector method. - # result = client.create_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest - - # Converts hash and nil to 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :create_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 Annotation - # - # @overload create_annotation(request, options = nil) - # Pass arguments to `create_annotation` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_annotation(parent: nil, annotation: nil, request_id: nil) - # Pass arguments to `create_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent (project+location). - # @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new - # - # # Call the create_annotation method. - # result = client.create_annotation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest - - # Converts hash and nil to 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_annotation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :create_annotation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 details of a single Annotation. - # - # @overload get_annotation(request, options = nil) - # Pass arguments to `get_annotation` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_annotation(name: nil) - # Pass arguments to `get_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Annotation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new - # - # # Call the get_annotation method. - # result = client.get_annotation request - # - # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. - # p result - # - def get_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_annotation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :get_annotation, request, 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 Collectors in a given project and location. - # - # @overload list_collectors(request, options = nil) - # Pass arguments to `list_collectors` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_collectors` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListCollectorsRequest. - # @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] - # 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::RapidMigrationAssessment::V1::Collector>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new - # - # # Call the list_collectors method. - # result = client.list_collectors request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. - # p item - # end - # - def list_collectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_collectors.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_collectors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_collectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :list_collectors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @rapid_migration_assessment_stub, :list_collectors, request, response, 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 Collector. - # - # @overload get_collector(request, options = nil) - # Pass arguments to `get_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_collector(name: nil) - # Pass arguments to `get_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Collector] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new - # - # # Call the get_collector method. - # result = client.get_collector request - # - # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. - # p result - # - def get_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :get_collector, request, 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 parameters of a single Collector. - # - # @overload update_collector(request, options = nil) - # Pass arguments to `update_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_collector(update_mask: nil, collector: nil, request_id: nil) - # Pass arguments to `update_collector` via keyword arguments. Note that at - # least one keyword argument is 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 - # Collector 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 collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] - # Required. The resource being updated. - # @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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new - # - # # Call the update_collector method. - # result = client.update_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest - - # Converts hash and nil to 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.collector&.name - header_params["collector.name"] = request.collector.name - end - - request_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_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :update_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 Collector - changes state of collector to "Deleting". - # Background jobs does final deletion through producer API. - # - # @overload delete_collector(request, options = nil) - # Pass arguments to `delete_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_collector(name: nil, request_id: nil) - # Pass arguments to `delete_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new - # - # # Call the delete_collector method. - # result = client.delete_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :delete_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resumes the given collector. - # - # @overload resume_collector(request, options = nil) - # Pass arguments to `resume_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) - # Pass arguments to `resume_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new - # - # # Call the resume_collector method. - # result = client.resume_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def resume_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest - - # Converts hash and nil to 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :resume_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Registers the given collector. - # - # @overload register_collector(request, options = nil) - # Pass arguments to `register_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload register_collector(name: nil, request_id: nil) - # Pass arguments to `register_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new - # - # # Call the register_collector method. - # result = client.register_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def register_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.register_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.register_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.register_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :register_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the given collector. - # - # @overload pause_collector(request, options = nil) - # Pass arguments to `pause_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) - # Pass arguments to `pause_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new - # - # # Call the pause_collector method. - # result = client.pause_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def pause_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest - - # Converts hash and nil to 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_collector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.call_rpc :pause_collector, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 RapidMigrationAssessment API. - # - # This class represents the configuration for RapidMigrationAssessment, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_collector to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_collector.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_collector.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 = "rapidmigrationassessment.googleapis.com" - - config_attr :endpoint, nil, ::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 RapidMigrationAssessment API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_collector - ## - # RPC-specific configuration for `create_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_annotation - ## - # RPC-specific configuration for `get_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation - ## - # RPC-specific configuration for `list_collectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collectors - ## - # RPC-specific configuration for `get_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_collector - ## - # RPC-specific configuration for `update_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :update_collector - ## - # RPC-specific configuration for `delete_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_collector - ## - # RPC-specific configuration for `resume_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_collector - ## - # RPC-specific configuration for `register_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :register_collector - ## - # RPC-specific configuration for `pause_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_collector - - # @private - def initialize parent_rpcs = nil - create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector - @create_collector = ::Gapic::Config::Method.new create_collector_config - create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation - @create_annotation = ::Gapic::Config::Method.new create_annotation_config - get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation - @get_annotation = ::Gapic::Config::Method.new get_annotation_config - list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors - @list_collectors = ::Gapic::Config::Method.new list_collectors_config - get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector - @get_collector = ::Gapic::Config::Method.new get_collector_config - update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector - @update_collector = ::Gapic::Config::Method.new update_collector_config - delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector - @delete_collector = ::Gapic::Config::Method.new delete_collector_config - resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector - @resume_collector = ::Gapic::Config::Method.new resume_collector_config - register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector - @register_collector = ::Gapic::Config::Method.new register_collector_config - pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector - @pause_collector = ::Gapic::Config::Method.new pause_collector_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb deleted file mode 100644 index 976a42c0b7d1..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - # Credentials for the RapidMigrationAssessment 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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb deleted file mode 100644 index 48934964490d..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the RapidMigrationAssessment 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 RapidMigrationAssessment 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::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RapidMigrationAssessment::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RapidMigrationAssessment::V1::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 = "rapidmigrationassessment.googleapis.com" - - config_attr :endpoint, nil, ::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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb deleted file mode 100644 index 8ff57cfe326b..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - # Path helper methods for the RapidMigrationAssessment API. - module Paths - ## - # Create a fully-qualified Annotation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/annotations/{annotation}` - # - # @param project [String] - # @param location [String] - # @param annotation [String] - # - # @return [::String] - def annotation_path project:, location:, annotation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/annotations/#{annotation}" - end - - ## - # Create a fully-qualified Collector resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collectors/{collector}` - # - # @param project [String] - # @param location [String] - # @param collector [String] - # - # @return [::String] - def collector_path project:, location:, collector: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collectors/#{collector}" - 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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb deleted file mode 100644 index b26012a3f87c..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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/rapid_migration_assessment/v1/version" -require "google/cloud/rapid_migration_assessment/v1/bindings_override" - -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client" - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - ## - # Service describing handlers for resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - module RapidMigrationAssessment - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb deleted file mode 100644 index b9508970a13a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb +++ /dev/null @@ -1,1422 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - module Rest - ## - # REST client for the RapidMigrationAssessment service. - # - # Service describing handlers for resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :rapid_migration_assessment_stub - - ## - # Configure the RapidMigrationAssessment Client class. - # - # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RapidMigrationAssessment clients - # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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", "RapidMigrationAssessment", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_collector.timeout = 60.0 - - default_config.rpcs.create_annotation.timeout = 60.0 - - default_config.rpcs.get_annotation.timeout = 60.0 - default_config.rpcs.get_annotation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_collectors.timeout = 60.0 - default_config.rpcs.list_collectors.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_collector.timeout = 60.0 - default_config.rpcs.get_collector.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_collector.timeout = 60.0 - - default_config.rpcs.delete_collector.timeout = 60.0 - - default_config.rpcs.resume_collector.timeout = 60.0 - - default_config.rpcs.register_collector.timeout = 60.0 - - default_config.rpcs.pause_collector.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RapidMigrationAssessment Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 - @rapid_migration_assessment_stub.universe_domain - end - - ## - # Create a new RapidMigrationAssessment REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RapidMigrationAssessment 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 - - @rapid_migration_assessment_stub = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @rapid_migration_assessment_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 = @rapid_migration_assessment_stub.endpoint - config.universe_domain = @rapid_migration_assessment_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @rapid_migration_assessment_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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 - @rapid_migration_assessment_stub.logger - end - - # Service calls - - ## - # Create a Collector to manage the on-prem appliance which collects - # information about Customer assets. - # - # @overload create_collector(request, options = nil) - # Pass arguments to `create_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil) - # Pass arguments to `create_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent (project+location). - # @param collector_id [::String] - # Required. Id of the requesting object. - # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new - # - # # Call the create_collector method. - # result = client.create_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest - - # Converts hash and nil to an 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.create_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Annotation - # - # @overload create_annotation(request, options = nil) - # Pass arguments to `create_annotation` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_annotation(parent: nil, annotation: nil, request_id: nil) - # Pass arguments to `create_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of the parent (project+location). - # @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new - # - # # Call the create_annotation method. - # result = client.create_annotation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest - - # Converts hash and nil to an 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_annotation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.create_annotation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Annotation. - # - # @overload get_annotation(request, options = nil) - # Pass arguments to `get_annotation` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_annotation(name: nil) - # Pass arguments to `get_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new - # - # # Call the get_annotation method. - # result = client.get_annotation request - # - # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. - # p result - # - def get_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_annotation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.get_annotation request, 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 Collectors in a given project and location. - # - # @overload list_collectors(request, options = nil) - # Pass arguments to `list_collectors` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_collectors` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListCollectorsRequest. - # @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] - # 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::RapidMigrationAssessment::V1::Collector>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new - # - # # Call the list_collectors method. - # result = client.list_collectors request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. - # p item - # end - # - def list_collectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_collectors.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_collectors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_collectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.list_collectors request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @rapid_migration_assessment_stub, :list_collectors, "collectors", request, result, 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 Collector. - # - # @overload get_collector(request, options = nil) - # Pass arguments to `get_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_collector(name: nil) - # Pass arguments to `get_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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::RapidMigrationAssessment::V1::Collector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new - # - # # Call the get_collector method. - # result = client.get_collector request - # - # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. - # p result - # - def get_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.get_collector request, 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 parameters of a single Collector. - # - # @overload update_collector(request, options = nil) - # Pass arguments to `update_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_collector(update_mask: nil, collector: nil, request_id: nil) - # Pass arguments to `update_collector` via keyword arguments. Note that at - # least one keyword argument is 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 - # Collector 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 collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash] - # Required. The resource being updated. - # @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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new - # - # # Call the update_collector method. - # result = client.update_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest - - # Converts hash and nil to an 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.update_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 Collector - changes state of collector to "Deleting". - # Background jobs does final deletion through producer API. - # - # @overload delete_collector(request, options = nil) - # Pass arguments to `delete_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_collector(name: nil, request_id: nil) - # Pass arguments to `delete_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new - # - # # Call the delete_collector method. - # result = client.delete_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest - - # Converts hash and nil to an 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.delete_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resumes the given collector. - # - # @overload resume_collector(request, options = nil) - # Pass arguments to `resume_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) - # Pass arguments to `resume_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new - # - # # Call the resume_collector method. - # result = client.resume_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def resume_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest - - # Converts hash and nil to an 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.resume_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Registers the given collector. - # - # @overload register_collector(request, options = nil) - # Pass arguments to `register_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload register_collector(name: nil, request_id: nil) - # Pass arguments to `register_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new - # - # # Call the register_collector method. - # result = client.register_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def register_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.register_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.register_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.register_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.register_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the given collector. - # - # @overload pause_collector(request, options = nil) - # Pass arguments to `pause_collector` via a request object, either of type - # {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collector(name: nil, request_id: nil) - # Pass arguments to `pause_collector` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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/rapid_migration_assessment/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new - # - # # Call the pause_collector method. - # result = client.pause_collector request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def pause_collector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest - - # Converts hash and nil to an 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_collector.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_collector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_collector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rapid_migration_assessment_stub.pause_collector request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 RapidMigrationAssessment REST API. - # - # This class represents the configuration for RapidMigrationAssessment 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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_collector.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_collector.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "rapidmigrationassessment.googleapis.com" - - config_attr :endpoint, nil, ::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 RapidMigrationAssessment API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_collector - ## - # RPC-specific configuration for `create_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_annotation - ## - # RPC-specific configuration for `get_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation - ## - # RPC-specific configuration for `list_collectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collectors - ## - # RPC-specific configuration for `get_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_collector - ## - # RPC-specific configuration for `update_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :update_collector - ## - # RPC-specific configuration for `delete_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_collector - ## - # RPC-specific configuration for `resume_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_collector - ## - # RPC-specific configuration for `register_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :register_collector - ## - # RPC-specific configuration for `pause_collector` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_collector - - # @private - def initialize parent_rpcs = nil - create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector - @create_collector = ::Gapic::Config::Method.new create_collector_config - create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation - @create_annotation = ::Gapic::Config::Method.new create_annotation_config - get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation - @get_annotation = ::Gapic::Config::Method.new get_annotation_config - list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors - @list_collectors = ::Gapic::Config::Method.new list_collectors_config - get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector - @get_collector = ::Gapic::Config::Method.new get_collector_config - update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector - @update_collector = ::Gapic::Config::Method.new update_collector_config - delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector - @delete_collector = ::Gapic::Config::Method.new delete_collector_config - resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector - @resume_collector = ::Gapic::Config::Method.new resume_collector_config - register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector - @register_collector = ::Gapic::Config::Method.new register_collector_config - pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector - @pause_collector = ::Gapic::Config::Method.new pause_collector_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb deleted file mode 100644 index fd12e4bbf903..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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 RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "rapidmigrationassessment.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the RapidMigrationAssessment 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 RapidMigrationAssessment 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::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::RapidMigrationAssessment::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "rapidmigrationassessment.googleapis.com" - - config_attr :endpoint, nil, ::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-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb deleted file mode 100644 index 4309790cbd20..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - module Rest - ## - # REST service stub for the RapidMigrationAssessment 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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_annotation REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_annotation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_annotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_annotation REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] - # A result object deserialized from the server's reply - def get_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_annotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.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_collectors REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse] - # A result object deserialized from the server's reply - def list_collectors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_collectors_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_collectors", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # A result object deserialized from the server's reply - def get_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def resume_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the register_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def register_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_register_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "register_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def pause_collector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_collector_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_collector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest] - # 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_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/collectors", - body: "collector", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_annotation REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest] - # 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_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/annotations", - body: "annotation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_annotation REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/annotations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_collectors REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_collectors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/collectors", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest] - # 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_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{collector.name}", - body: "collector", - matches: [ - ["collector.name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest] - # 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_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest] - # 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_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the register_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_register_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:register", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_collector REST call - # - # @param request_pb [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest] - # 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_collector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rest.rb deleted file mode 100644 index 4f296b183c65..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/v1/rapid_migration_assessment/rest" -require "google/cloud/rapid_migration_assessment/v1/bindings_override" -require "google/cloud/rapid_migration_assessment/v1/version" - -module Google - module Cloud - module RapidMigrationAssessment - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/rapid_migration_assessment/v1/rest" - # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/version.rb deleted file mode 100644 index 4c6ae2c4276a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb deleted file mode 100644 index 91d68192dc7d..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/rapidmigrationassessment/v1/api_entities.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/rapidmigrationassessment/v1/api_entities.proto\x12(google.cloud.rapidmigrationassessment.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\"\n\x0bGuestOsScan\x12\x13\n\x0b\x63ore_source\x18\x01 \x01(\t\"\"\n\x0bVSphereScan\x12\x13\n\x0b\x63ore_source\x18\x01 \x01(\t\"\xfa\x07\n\tCollector\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12O\n\x06labels\x18\x04 \x03(\x0b\x32?.google.cloud.rapidmigrationassessment.v1.Collector.LabelsEntry\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x17\n\x0fservice_account\x18\x07 \x01(\t\x12\x13\n\x06\x62ucket\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x14\x65xpected_asset_count\x18\t \x01(\x03\x12M\n\x05state\x18\n \x01(\x0e\x32\x39.google.cloud.rapidmigrationassessment.v1.Collector.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x63lient_version\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12Q\n\rguest_os_scan\x18\x0c \x01(\x0b\x32\x35.google.cloud.rapidmigrationassessment.v1.GuestOsScanB\x03\xe0\x41\x03\x12P\n\x0cvsphere_scan\x18\r \x01(\x0b\x32\x35.google.cloud.rapidmigrationassessment.v1.VSphereScanB\x03\xe0\x41\x03\x12\x17\n\x0f\x63ollection_days\x18\x0e \x01(\x05\x12\x10\n\x08\x65ula_uri\x18\x0f \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x16\n\x12STATE_INITIALIZING\x10\x01\x12\x16\n\x12STATE_READY_TO_USE\x10\x02\x12\x14\n\x10STATE_REGISTERED\x10\x03\x12\x10\n\x0cSTATE_ACTIVE\x10\x04\x12\x10\n\x0cSTATE_PAUSED\x10\x05\x12\x12\n\x0eSTATE_DELETING\x10\x06\x12\x18\n\x14STATE_DECOMMISSIONED\x10\x07\x12\x0f\n\x0bSTATE_ERROR\x10\x08:v\xea\x41s\n1rapidmigrationassessment.googleapis.com/Collector\x12>projects/{project}/locations/{location}/collectors/{collector}\"\x9b\x04\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x06labels\x18\x04 \x03(\x0b\x32@.google.cloud.rapidmigrationassessment.v1.Annotation.LabelsEntry\x12G\n\x04type\x18\x05 \x01(\x0e\x32\x39.google.cloud.rapidmigrationassessment.v1.Annotation.Type\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"N\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aTYPE_LEGACY_EXPORT_CONSENT\x10\x01\x12\x10\n\x0cTYPE_QWIKLAB\x10\x02:y\xea\x41v\n2rapidmigrationassessment.googleapis.com/Annotation\x12@projects/{project}/locations/{location}/annotations/{annotation}B\xb0\x02\n,com.google.cloud.rapidmigrationassessment.v1B\x10\x41piEntitiesProtoP\x01Zhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb\xaa\x02(Google.Cloud.RapidMigrationAssessment.V1\xca\x02(Google\\Cloud\\RapidMigrationAssessment\\V1\xea\x02+Google::Cloud::RapidMigrationAssessment::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"], - ] - 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 RapidMigrationAssessment - module V1 - GuestOsScan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GuestOsScan").msgclass - VSphereScan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.VSphereScan").msgclass - Collector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Collector").msgclass - Collector::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Collector.State").enummodule - Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Annotation").msgclass - Annotation::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.Annotation.Type").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb deleted file mode 100644 index 31e510321760..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.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/rapidmigrationassessment/v1/api_entities_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nGgoogle/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto\x12(google.cloud.rapidmigrationassessment.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/rapidmigrationassessment/v1/api_entities.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbc\x01\n\x17\x43reateAnnotationRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12M\n\nannotation\x18\x02 \x01(\x0b\x32\x34.google.cloud.rapidmigrationassessment.v1.AnnotationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"`\n\x14GetAnnotationRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2rapidmigrationassessment.googleapis.com/Annotation\"\xd4\x01\n\x16\x43reateCollectorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0c\x63ollector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\tcollector\x18\x03 \x01(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.CollectorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x15ListCollectorsRequest\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\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x8f\x01\n\x16ListCollectorsResponse\x12G\n\ncollectors\x18\x01 \x03(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.Collector\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"^\n\x13GetCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\"z\n\x16\x44\x65leteCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb4\x01\n\x16UpdateCollectorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12K\n\tcollector\x18\x02 \x01(\x0b\x32\x33.google.cloud.rapidmigrationassessment.v1.CollectorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"z\n\x16ResumeCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"|\n\x18RegisterCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"y\n\x15PauseCollectorRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1rapidmigrationassessment.googleapis.com/Collector\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\x32\xb7\x12\n\x18RapidMigrationAssessment\x12\xf7\x01\n\x0f\x43reateCollector\x12@.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x1dparent,collector,collector_id\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/collectors:\tcollector\x12\xef\x01\n\x10\x43reateAnnotation\x12\x41.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1f\n\nAnnotation\x12\x11OperationMetadata\xda\x41\x11parent,annotation\x82\xd3\xe4\x93\x02=\"//v1/{parent=projects/*/locations/*}/annotations:\nannotation\x12\xc5\x01\n\rGetAnnotation\x12>.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest\x1a\x34.google.cloud.rapidmigrationassessment.v1.Annotation\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/annotations/*}\x12\xd4\x01\n\x0eListCollectors\x12?.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest\x1a@.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/collectors\x12\xc1\x01\n\x0cGetCollector\x12=.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest\x1a\x33.google.cloud.rapidmigrationassessment.v1.Collector\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/collectors/*}\x12\xf9\x01\n\x0fUpdateCollector\x12@.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x15\x63ollector,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v1/{collector.name=projects/*/locations/*/collectors/*}:\tcollector\x12\xd2\x01\n\x0f\x44\x65leteCollector\x12@.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest\x1a\x1d.google.longrunning.Operation\"^\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/collectors/*}\x12\xdc\x01\n\x0fResumeCollector\x12@.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v1/{name=projects/*/locations/*/collectors/*}:resume:\x01*\x12\xe2\x01\n\x11RegisterCollector\x12\x42.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/locations/*/collectors/*}:register:\x01*\x12\xd9\x01\n\x0ePauseCollector\x12?.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41\x1e\n\tCollector\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/collectors/*}:pause:\x01*\x1a[\xca\x41\'rapidmigrationassessment.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbd\x02\n,com.google.cloud.rapidmigrationassessment.v1B\x1dRapidMigrationAssessmentProtoP\x01Zhcloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb\xaa\x02(Google.Cloud.RapidMigrationAssessment.V1\xca\x02(Google\\Cloud\\RapidMigrationAssessment\\V1\xea\x02+Google::Cloud::RapidMigrationAssessment::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.rapidmigrationassessment.v1.Annotation", "google/cloud/rapidmigrationassessment/v1/api_entities.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 RapidMigrationAssessment - module V1 - CreateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest").msgclass - GetAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest").msgclass - CreateCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest").msgclass - ListCollectorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest").msgclass - ListCollectorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse").msgclass - GetCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.GetCollectorRequest").msgclass - DeleteCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest").msgclass - UpdateCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest").msgclass - ResumeCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest").msgclass - RegisterCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest").msgclass - PauseCollectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.rapidmigrationassessment.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb deleted file mode 100644 index 29b1a1c8f0cb..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto for package 'Google.Cloud.RapidMigrationAssessment.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/rapidmigrationassessment/v1/rapidmigrationassessment_pb' - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - module RapidMigrationAssessment - # Service describing handlers for resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment' - - # Create a Collector to manage the on-prem appliance which collects - # information about Customer assets. - rpc :CreateCollector, ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Google::Longrunning::Operation - # Creates an Annotation - rpc :CreateAnnotation, ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Google::Longrunning::Operation - # Gets details of a single Annotation. - rpc :GetAnnotation, ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Google::Cloud::RapidMigrationAssessment::V1::Annotation - # Lists Collectors in a given project and location. - rpc :ListCollectors, ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse - # Gets details of a single Collector. - rpc :GetCollector, ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Google::Cloud::RapidMigrationAssessment::V1::Collector - # Updates the parameters of a single Collector. - rpc :UpdateCollector, ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Google::Longrunning::Operation - # Deletes a single Collector - changes state of collector to "Deleting". - # Background jobs does final deletion through producer API. - rpc :DeleteCollector, ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Google::Longrunning::Operation - # Resumes the given collector. - rpc :ResumeCollector, ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Google::Longrunning::Operation - # Registers the given collector. - rpc :RegisterCollector, ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Google::Longrunning::Operation - # Pauses the given collector. - rpc :PauseCollector, ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md deleted file mode 100644 index ee165a3c3e33..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Rapid Migration Assessment 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-rapid_migration_assessment-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb deleted file mode 100644 index aed03420ed4e..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.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 RapidMigrationAssessment - module V1 - # Message describing a MC Source of type Guest OS Scan. - # @!attribute [rw] core_source - # @return [::String] - # reference to the corresponding Guest OS Scan in MC Source. - class GuestOsScan - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing a MC Source of type VSphere Scan. - # @!attribute [rw] core_source - # @return [::String] - # reference to the corresponding VSphere Scan in MC Source. - class VSphereScan - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Collector object. - # @!attribute [rw] name - # @return [::String] - # name of resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] display_name - # @return [::String] - # User specified name of the Collector. - # @!attribute [rw] description - # @return [::String] - # User specified description of the Collector. - # @!attribute [rw] service_account - # @return [::String] - # Service Account email used to ingest data to this Collector. - # @!attribute [r] bucket - # @return [::String] - # Output only. Store cloud storage bucket name (which is a guid) created with - # this Collector. - # @!attribute [rw] expected_asset_count - # @return [::Integer] - # User specified expected asset count. - # @!attribute [r] state - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector::State] - # Output only. State of the Collector. - # @!attribute [r] client_version - # @return [::String] - # Output only. Client version. - # @!attribute [r] guest_os_scan - # @return [::Google::Cloud::RapidMigrationAssessment::V1::GuestOsScan] - # Output only. Reference to MC Source Guest Os Scan. - # @!attribute [r] vsphere_scan - # @return [::Google::Cloud::RapidMigrationAssessment::V1::VSphereScan] - # Output only. Reference to MC Source vsphere_scan. - # @!attribute [rw] collection_days - # @return [::Integer] - # How many days to collect data. - # @!attribute [rw] eula_uri - # @return [::String] - # Uri for EULA (End User License Agreement) from customer. - class Collector - 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 - - # -- Using suggestion from API Linter Analyzer for nesting enum -- - # -- https://linter.aip.dev/216/nesting -- - # State of a Collector (server_side). - # States are used for internal purposes and named to keep - # convention of legacy product: - # https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe. - module State - # Collector state is not recognized. - STATE_UNSPECIFIED = 0 - - # Collector started to create, but hasn't been completed MC source creation - # and db object creation. - STATE_INITIALIZING = 1 - - # Collector has been created, MC source creation and db object creation - # completed. - STATE_READY_TO_USE = 2 - - # Collector client has been registered with client. - STATE_REGISTERED = 3 - - # Collector client is actively scanning. - STATE_ACTIVE = 4 - - # Collector is not actively scanning. - STATE_PAUSED = 5 - - # Collector is starting background job for deletion. - STATE_DELETING = 6 - - # Collector completed all tasks for deletion. - STATE_DECOMMISSIONED = 7 - - # Collector is in error state. - STATE_ERROR = 8 - end - end - - # Message describing an Annotation - # @!attribute [rw] name - # @return [::String] - # name of resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] type - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation::Type] - # Type of an annotation. - class Annotation - 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 - - # Types for project level setting. - module Type - # Unknown type - TYPE_UNSPECIFIED = 0 - - # Indicates that this project has opted into StratoZone export. - TYPE_LEGACY_EXPORT_CONSENT = 1 - - # Indicates that this project is created by Qwiklab. - TYPE_QWIKLAB = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb deleted file mode 100644 index a2b299a0f1d0..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb +++ /dev/null @@ -1,272 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RapidMigrationAssessment - module V1 - # Message for creating an AnnotationS. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent (project+location). - # @!attribute [rw] annotation - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. - class CreateAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a specific Annotation - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Collector. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent (project+location). - # @!attribute [rw] collector_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] collector - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. - class CreateCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Collectors. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListCollectorsRequest. - # @!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] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListCollectorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Collectors. - # @!attribute [rw] collectors - # @return [::Array<::Google::Cloud::RapidMigrationAssessment::V1::Collector>] - # The list of Collectors. - # @!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 ListCollectorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a specific Collector. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Collector. - # @!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 DeleteCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Collector. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Collector 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] collector - # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector] - # Required. The resource being updated. - # @!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 UpdateCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for resuming a Collector. - # @!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 ResumeCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for registering a Collector. - # @!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 RegisterCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for pausing a Collector. - # @!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 PauseCollectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/Gemfile deleted file mode 100644 index 2884289a7883..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1", path: "../" -else - gem "google-cloud-rapid_migration_assessment-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-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.rb deleted file mode 100644 index 4984dff6d462..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_annotation.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the create_annotation call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation. -# -def create_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new - - # Call the create_annotation method. - result = client.create_annotation request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.rb deleted file mode 100644 index 882556aa673b..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/create_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the create_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector. -# -def create_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new - - # Call the create_collector method. - result = client.create_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.rb deleted file mode 100644 index 5eb78f44fb79..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/delete_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the delete_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector. -# -def delete_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new - - # Call the delete_collector method. - result = client.delete_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb deleted file mode 100644 index 9f527cffba71..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_annotation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the get_annotation call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation. -# -def get_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new - - # Call the get_annotation method. - result = client.get_annotation request - - # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation. - p result -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb deleted file mode 100644 index d233ac84a69a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/get_collector.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the get_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector. -# -def get_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new - - # Call the get_collector method. - result = client.get_collector request - - # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector. - p result -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.rb deleted file mode 100644 index 99b9954c3d10..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/list_collectors.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the list_collectors call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors. -# -def list_collectors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new - - # Call the list_collectors method. - result = client.list_collectors request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector. - p item - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.rb deleted file mode 100644 index f248a1b4c0fe..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/pause_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the pause_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector. -# -def pause_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new - - # Call the pause_collector method. - result = client.pause_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.rb deleted file mode 100644 index e4214e5472e3..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/register_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the register_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector. -# -def register_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new - - # Call the register_collector method. - result = client.register_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.rb deleted file mode 100644 index a2885af3fc14..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/resume_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the resume_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector. -# -def resume_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new - - # Call the resume_collector method. - result = client.resume_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.rb deleted file mode 100644 index 83eec5feb472..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/rapid_migration_assessment/update_collector.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] -require "google/cloud/rapid_migration_assessment/v1" - -## -# Snippet for the update_collector call in the RapidMigrationAssessment service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector. -# -def update_collector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new - - # Call the update_collector method. - result = client.update_collector request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json deleted file mode 100644 index 160c42b58912..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/snippets/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-rapid_migration_assessment-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.rapidmigrationassessment.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync", - "title": "Snippet for the create_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector.", - "file": "rapid_migration_assessment/create_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "CreateCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync", - "title": "Snippet for the create_annotation call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation.", - "file": "rapid_migration_assessment/create_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_annotation", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#create_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "CreateAnnotation", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.CreateAnnotation", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync", - "title": "Snippet for the get_annotation call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation.", - "file": "rapid_migration_assessment/get_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_annotation", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::Annotation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "GetAnnotation", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetAnnotation", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync", - "title": "Snippet for the list_collectors call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors.", - "file": "rapid_migration_assessment/list_collectors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_collectors", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#list_collectors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "ListCollectors", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ListCollectors", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync", - "title": "Snippet for the get_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector.", - "file": "rapid_migration_assessment/get_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#get_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RapidMigrationAssessment::V1::Collector", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "GetCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.GetCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync", - "title": "Snippet for the update_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector.", - "file": "rapid_migration_assessment/update_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#update_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "UpdateCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.UpdateCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync", - "title": "Snippet for the delete_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector.", - "file": "rapid_migration_assessment/delete_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#delete_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "DeleteCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.DeleteCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync", - "title": "Snippet for the resume_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector.", - "file": "rapid_migration_assessment/resume_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#resume_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "ResumeCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.ResumeCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync", - "title": "Snippet for the register_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector.", - "file": "rapid_migration_assessment/register_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "register_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#register_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "RegisterCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.RegisterCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync", - "title": "Snippet for the pause_collector call in the RapidMigrationAssessment service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector.", - "file": "rapid_migration_assessment/pause_collector.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_collector", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client#pause_collector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "RapidMigrationAssessment::Client", - "full_name": "::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client" - }, - "method": { - "short_name": "PauseCollector", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment.PauseCollector", - "service": { - "short_name": "RapidMigrationAssessment", - "full_name": "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment" - } - } - }, - "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-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb deleted file mode 100644 index 58907452501b..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" -require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" - -class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb deleted file mode 100644 index b87222a2b1a1..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_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/rapid_migration_assessment/v1/rapid_migration_assessment" - -class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_annotation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.annotation_path project: "value0", location: "value1", annotation: "value2" - assert_equal "projects/value0/locations/value1/annotations/value2", path - end - end - - def test_collector_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.collector_path project: "value0", location: "value1", collector: "value2" - assert_equal "projects/value0/locations/value1/collectors/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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb deleted file mode 100644 index 7d3fad47b643..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb +++ /dev/null @@ -1,654 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/rapidmigrationassessment/v1/rapidmigrationassessment_pb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest" - - -class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector - # Create test objects. - 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" - collector_id = "hello world" - collector = {} - request_id = "hello world" - - create_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_create_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_collector parent: parent, collector_id: collector_id, collector: collector, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_collector ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_collector(::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_collector_client_stub.call_count - end - end - end - - def test_create_annotation - # Create test objects. - 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" - annotation = {} - request_id = "hello world" - - create_annotation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_create_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_annotation_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_annotation({ parent: parent, annotation: annotation, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_annotation parent: parent, annotation: annotation, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_annotation ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_annotation({ parent: parent, annotation: annotation, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_annotation(::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_annotation_client_stub.call_count - end - end - end - - def test_get_annotation - # Create test objects. - client_result = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_annotation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_get_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_annotation_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_annotation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_annotation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_annotation ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_annotation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_annotation(::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_annotation_client_stub.call_count - end - end - end - - def test_list_collectors - # Create test objects. - client_result = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.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_collectors_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_list_collectors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_collectors_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_collectors({ 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_collectors 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_collectors ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors({ 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_collectors(::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors_client_stub.call_count - end - end - end - - def test_get_collector - # Create test objects. - client_result = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_get_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_collector({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_collector name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_collector ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_collector({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_collector(::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_collector_client_stub.call_count - end - end - end - - def test_update_collector - # Create test objects. - 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 = {} - collector = {} - request_id = "hello world" - - update_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_update_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_collector({ update_mask: update_mask, collector: collector, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_collector update_mask: update_mask, collector: collector, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_collector ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_collector({ update_mask: update_mask, collector: collector, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_collector(::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_collector_client_stub.call_count - end - end - end - - def test_delete_collector - # Create test objects. - 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_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_delete_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_collector({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_collector name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_collector ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector({ 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector_client_stub.call_count - end - end - end - - def test_resume_collector - # Create test objects. - 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" - - resume_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_resume_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_collector({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_collector name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_collector ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_collector({ 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.resume_collector(::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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, resume_collector_client_stub.call_count - end - end - end - - def test_register_collector - # Create test objects. - 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" - - register_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_register_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, register_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.register_collector({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.register_collector name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.register_collector ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.register_collector({ 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.register_collector(::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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, register_collector_client_stub.call_count - end - end - end - - def test_pause_collector - # Create test objects. - 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" - - pause_collector_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.stub :transcode_pause_collector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_collector({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_collector name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_collector ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_collector({ 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.pause_collector(::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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, pause_collector_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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb deleted file mode 100644 index f267aeb2fd60..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb +++ /dev/null @@ -1,768 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb" -require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" - -class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - collector_id = "hello world" - collector = {} - request_id = "hello world" - - create_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["collector_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Collector), request["collector"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_collector({ parent: parent, collector_id: collector_id, collector: collector, 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_collector parent: parent, collector_id: collector_id, collector: collector, 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, 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_collector({ parent: parent, collector_id: collector_id, collector: collector, 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new(parent: parent, collector_id: collector_id, collector: collector, 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_collector_client_stub.call_rpc_count - end - end - - def test_create_annotation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - annotation = {} - request_id = "hello world" - - create_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_annotation, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Annotation), request["annotation"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_annotation_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_annotation({ parent: parent, annotation: annotation, 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_annotation parent: parent, annotation: annotation, 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_annotation ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, 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_annotation({ parent: parent, annotation: annotation, 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_annotation(::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, 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_annotation_client_stub.call_rpc_count - end - end - - def test_get_annotation - # Create GRPC objects. - grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::Annotation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_annotation, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_annotation_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_annotation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_annotation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_annotation ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_annotation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_annotation(::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_annotation_client_stub.call_rpc_count - end - end - - def test_list_collectors - # Create GRPC objects. - grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_collectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_collectors, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, 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_collectors_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_collectors({ 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_collectors 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_collectors ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors({ 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_collectors(::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.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_collectors_client_stub.call_rpc_count - end - end - - def test_get_collector - # Create GRPC objects. - grpc_response = ::Google::Cloud::RapidMigrationAssessment::V1::Collector.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_collector({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_collector name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_collector ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_collector({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_collector(::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_collector_client_stub.call_rpc_count - end - end - - def test_update_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - collector = {} - request_id = "hello world" - - update_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RapidMigrationAssessment::V1::Collector), request["collector"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_collector({ update_mask: update_mask, collector: collector, 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_collector update_mask: update_mask, collector: collector, 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, 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_collector({ update_mask: update_mask, collector: collector, 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new(update_mask: update_mask, collector: collector, 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_collector_client_stub.call_rpc_count - end - end - - def test_delete_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_collector({ 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_collector 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_collector ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector({ 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_collector(::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.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_collector_client_stub.call_rpc_count - end - end - - def test_resume_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - resume_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_collector({ 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.resume_collector 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.resume_collector ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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.resume_collector({ 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.resume_collector(::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.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, resume_collector_client_stub.call_rpc_count - end - end - - def test_register_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - register_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :register_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, register_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.register_collector({ 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.register_collector 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.register_collector ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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.register_collector({ 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.register_collector(::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.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, register_collector_client_stub.call_rpc_count - end - end - - def test_pause_collector - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - pause_collector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_collector, name - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_collector_client_stub do - # Create client - client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_collector({ 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.pause_collector 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.pause_collector ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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.pause_collector({ 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.pause_collector(::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.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, pause_collector_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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment/.gitignore b/owl-bot-staging/google-cloud-rapid_migration_assessment/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/.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-rapid_migration_assessment/.repo-metadata.json b/owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json deleted file mode 100644 index b1587db22543..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "rapidmigrationassessment.googleapis.com", - "api_shortname": "rapidmigrationassessment", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment/latest", - "distribution_name": "google-cloud-rapid_migration_assessment", - "is_cloud": true, - "language": "ruby", - "name": "rapidmigrationassessment", - "name_pretty": "Rapid Migration Assessment API", - "product_documentation": "https://cloud.google.com/migration-center/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Rapid Migration Assessment service is our first-party migration assessment and planning tool.", - "ruby-cloud-product-url": "https://cloud.google.com/migration-center/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml b/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml deleted file mode 100644 index d4a47aeea4fa..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-rapid_migration_assessment.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-rapid_migration_assessment.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/.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-rapid_migration_assessment/.yardopts b/owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts deleted file mode 100644 index 1fcbd04b5c20..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Rapid Migration Assessment 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-rapid_migration_assessment/AUTHENTICATION.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md deleted file mode 100644 index 90c88f61aadb..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-rapid_migration_assessment 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-rapid_migration_assessment 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/rapid_migration_assessment" - -client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/rapid_migration_assessment" - -Google::Cloud::RapidMigrationAssessment.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment -``` - -### 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-rapid_migration_assessment -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/rapid_migration_assessment" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment -``` - -### 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-rapid_migration_assessment/CHANGELOG.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile b/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile deleted file mode 100644 index 443e9209c0ed..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-rapid_migration_assessment-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-rapid_migration_assessment.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-rapid_migration_assessment/LICENSE.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/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-rapid_migration_assessment/README.md b/owl-bot-staging/google-cloud-rapid_migration_assessment/README.md deleted file mode 100644 index 6cfd314394b3..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Rapid Migration Assessment API - -The Rapid Migration Assessment service is our first-party migration assessment and planning tool. - -The Rapid Migration Assessment service is our first-party migration assessment and planning tool. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-rapid_migration_assessment-v*`. -The gem `google-cloud-rapid_migration_assessment` 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-rapid_migration_assessment/latest) -for this library, google-cloud-rapid_migration_assessment, 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-rapid_migration_assessment-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/migration-center/docs) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-rapid_migration_assessment -``` - -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/rapidmigrationassessment.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/rapid_migration_assessment" - -client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment -request = ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new # (request fields as keyword arguments...) -response = client.create_collector 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-rapid_migration_assessment-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-rapid_migration_assessment-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-rapid_migration_assessment`. -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-rapid_migration_assessment-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-rapid_migration_assessment/Rakefile b/owl-bot-staging/google-cloud-rapid_migration_assessment/Rakefile deleted file mode 100644 index a4f6110ae221..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/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-rapid_migration_assessment 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/rapid_migration_assessment/v1/rapid_migration_assessment/credentials" - ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-rapid_migration_assessment" - header "google-cloud-rapid_migration_assessment rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-rapid_migration_assessment yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment 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-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec b/owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec deleted file mode 100644 index d96fcb198783..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/google-cloud-rapid_migration_assessment.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/rapid_migration_assessment/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-rapid_migration_assessment" - gem.version = Google::Cloud::RapidMigrationAssessment::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." - gem.summary = "The Rapid Migration Assessment service is our first-party migration assessment and planning tool." - 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-rapid_migration_assessment-v1", "~> 2.0" -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.rb deleted file mode 100644 index e24e54ee8658..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google-cloud-rapid_migration_assessment.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/rapid_migration_assessment" unless defined? Google::Cloud::RapidMigrationAssessment::VERSION diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb deleted file mode 100644 index defccdc5bf20..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment.rb +++ /dev/null @@ -1,156 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/rapid_migration_assessment/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! :rapid_migration_assessment 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 RapidMigrationAssessment - ## - # Create a new client object for RapidMigrationAssessment. - # - # By default, this returns an instance of - # [Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-rapid_migration_assessment-v1/latest/Google-Cloud-RapidMigrationAssessment-V1-RapidMigrationAssessment-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 RapidMigrationAssessment 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 RapidMigrationAssessment service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_available?}. - # - # ## About RapidMigrationAssessment - # - # Service describing handlers for resources. - # - # @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.rapid_migration_assessment version: :v1, transport: :grpc, &block - require "google/cloud/rapid_migration_assessment/#{version.to_s.downcase}" - - package_name = Google::Cloud::RapidMigrationAssessment - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RapidMigrationAssessment.const_get(package_name).const_get(:RapidMigrationAssessment) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the RapidMigrationAssessment service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the RapidMigrationAssessment service, - # or if the versioned client gem needs an update to support the RapidMigrationAssessment 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.rapid_migration_assessment_available? version: :v1, transport: :grpc - require "google/cloud/rapid_migration_assessment/#{version.to_s.downcase}" - package_name = Google::Cloud::RapidMigrationAssessment - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RapidMigrationAssessment.const_get package_name - return false unless service_module.const_defined? :RapidMigrationAssessment - service_module = service_module.const_get :RapidMigrationAssessment - 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-rapid_migration_assessment 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.rapid_migration_assessment if block_given? - - ::Google::Cloud.configure.rapid_migration_assessment - end - end - end -end - -helper_path = ::File.join __dir__, "rapid_migration_assessment", "helpers.rb" -require "google/cloud/rapid_migration_assessment/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/version.rb deleted file mode 100644 index 8be3c821a1fd..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/lib/google/cloud/rapid_migration_assessment/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 RapidMigrationAssessment - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/client_test.rb deleted file mode 100644 index 705fb490d739..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::RapidMigrationAssessment::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_rapid_migration_assessment_grpc - skip unless Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_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::RapidMigrationAssessment.rapid_migration_assessment transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client, client - end - end - - def test_rapid_migration_assessment_rest - skip unless Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::RapidMigrationAssessment.rapid_migration_assessment transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/version_test.rb deleted file mode 100644 index 61766b818718..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/google/cloud/rapid_migration_assessment/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/rapid_migration_assessment/version" - -class Google::Cloud::RapidMigrationAssessment::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::RapidMigrationAssessment::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb b/owl-bot-staging/google-cloud-rapid_migration_assessment/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-rapid_migration_assessment/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-recaptcha_enterprise-v1/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json deleted file mode 100644 index 3e4db3422126..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recaptchaenterprise.googleapis.com", - "api_shortname": "recaptchaenterprise", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest", - "distribution_name": "google-cloud-recaptcha_enterprise-v1", - "is_cloud": true, - "language": "ruby", - "name": "recaptchaenterprise", - "name_pretty": "reCAPTCHA Enterprise V1 API", - "product_documentation": "https://cloud.google.com/recaptcha-enterprise", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", - "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml deleted file mode 100644 index 8ef5ef06ddf8..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts deleted file mode 100644 index b645b56b6f54..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="reCAPTCHA Enterprise 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-recaptcha_enterprise-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md deleted file mode 100644 index 5c2af6e5e391..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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/recaptcha_enterprise/v1" - -client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recaptcha_enterprise/v1" - -::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise-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/recaptcha_enterprise/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md deleted file mode 100644 index 6510d87e0136..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the reCAPTCHA Enterprise V1 API - -Help protect your website from fraudulent activity, spam, and abuse without creating friction. - -reCAPTCHA Enterprise is a service that protects your site from spam and abuse. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the reCAPTCHA Enterprise V1 API. Most users should consider using -the main client gem, -[google-cloud-recaptcha_enterprise](https://rubygems.org/gems/google-cloud-recaptcha_enterprise). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-recaptcha_enterprise-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/recaptchaenterprise.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/recaptcha_enterprise/v1" - -client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -request = ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new # (request fields as keyword arguments...) -response = client.create_assessment request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) -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/recaptcha_enterprise/v1" -require "logger" - -client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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-recaptcha_enterprise`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. -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-recaptcha_enterprise-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-recaptcha_enterprise-v1/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/Rakefile deleted file mode 100644 index 5d19c638aa73..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" - ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recaptcha_enterprise-v1" - header "google-cloud-recaptcha_enterprise-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recaptcha_enterprise-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json deleted file mode 100644 index 401c9dadcea7..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/gapic_metadata.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.recaptchaenterprise.v1", - "libraryPackage": "::Google::Cloud::RecaptchaEnterprise::V1", - "services": { - "RecaptchaEnterpriseService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client", - "rpcs": { - "CreateAssessment": { - "methods": [ - "create_assessment" - ] - }, - "AnnotateAssessment": { - "methods": [ - "annotate_assessment" - ] - }, - "CreateKey": { - "methods": [ - "create_key" - ] - }, - "ListKeys": { - "methods": [ - "list_keys" - ] - }, - "RetrieveLegacySecretKey": { - "methods": [ - "retrieve_legacy_secret_key" - ] - }, - "GetKey": { - "methods": [ - "get_key" - ] - }, - "UpdateKey": { - "methods": [ - "update_key" - ] - }, - "DeleteKey": { - "methods": [ - "delete_key" - ] - }, - "MigrateKey": { - "methods": [ - "migrate_key" - ] - }, - "AddIpOverride": { - "methods": [ - "add_ip_override" - ] - }, - "RemoveIpOverride": { - "methods": [ - "remove_ip_override" - ] - }, - "ListIpOverrides": { - "methods": [ - "list_ip_overrides" - ] - }, - "GetMetrics": { - "methods": [ - "get_metrics" - ] - }, - "CreateFirewallPolicy": { - "methods": [ - "create_firewall_policy" - ] - }, - "ListFirewallPolicies": { - "methods": [ - "list_firewall_policies" - ] - }, - "GetFirewallPolicy": { - "methods": [ - "get_firewall_policy" - ] - }, - "UpdateFirewallPolicy": { - "methods": [ - "update_firewall_policy" - ] - }, - "DeleteFirewallPolicy": { - "methods": [ - "delete_firewall_policy" - ] - }, - "ReorderFirewallPolicies": { - "methods": [ - "reorder_firewall_policies" - ] - }, - "ListRelatedAccountGroups": { - "methods": [ - "list_related_account_groups" - ] - }, - "ListRelatedAccountGroupMemberships": { - "methods": [ - "list_related_account_group_memberships" - ] - }, - "SearchRelatedAccountGroupMemberships": { - "methods": [ - "search_related_account_group_memberships" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec deleted file mode 100644 index 236873440b9e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/google-cloud-recaptcha_enterprise-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recaptcha_enterprise/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recaptcha_enterprise-v1" - gem.version = Google::Cloud::RecaptchaEnterprise::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details." - gem.summary = "Help protect your website from fraudulent activity, spam, and abuse without creating friction." - 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-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-v1.rb deleted file mode 100644 index 709bd158bdb6..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google-cloud-recaptcha_enterprise-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/recaptcha_enterprise/v1" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.rb deleted file mode 100644 index c0a5bb548e00..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1.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/recaptcha_enterprise/v1/recaptcha_enterprise_service" -require "google/cloud/recaptcha_enterprise/v1/version" - -module Google - module Cloud - module RecaptchaEnterprise - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/recaptcha_enterprise/v1" - # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/recaptcha_enterprise/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.rb deleted file mode 100644 index 2bbbe6309445..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service.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 "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/recaptcha_enterprise/v1/version" - -require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" -require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths" -require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client" - -module Google - module Cloud - module RecaptchaEnterprise - module V1 - ## - # Service to determine the likelihood an event is legitimate. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service" - # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - module RecaptchaEnterpriseService - end - end - end - end -end - -helper_path = ::File.join __dir__, "recaptcha_enterprise_service", "helpers.rb" -require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb deleted file mode 100644 index 81cd812def23..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb +++ /dev/null @@ -1,2609 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb" - -module Google - module Cloud - module RecaptchaEnterprise - module V1 - module RecaptchaEnterpriseService - ## - # Client for the RecaptchaEnterpriseService service. - # - # Service to determine the likelihood an event is legitimate. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recaptcha_enterprise_service_stub - - ## - # Configure the RecaptchaEnterpriseService Client class. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RecaptchaEnterpriseService clients - # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RecaptchaEnterprise", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_assessment.timeout = 600.0 - - default_config.rpcs.annotate_assessment.timeout = 600.0 - - default_config.rpcs.create_key.timeout = 600.0 - - default_config.rpcs.list_keys.timeout = 600.0 - - default_config.rpcs.get_key.timeout = 600.0 - - default_config.rpcs.update_key.timeout = 600.0 - - default_config.rpcs.delete_key.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RecaptchaEnterpriseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @recaptcha_enterprise_service_stub.universe_domain - end - - ## - # Create a new RecaptchaEnterpriseService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RecaptchaEnterpriseService 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/recaptchaenterprise/v1/recaptchaenterprise_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 - - @recaptcha_enterprise_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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 - ) - - @recaptcha_enterprise_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @recaptcha_enterprise_service_stub.logger - end - - # Service calls - - ## - # Creates an Assessment of the likelihood an event is legitimate. - # - # @overload create_assessment(request, options = nil) - # Pass arguments to `create_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_assessment(parent: nil, assessment: nil) - # Pass arguments to `create_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 project in which the assessment is created, - # in the format `projects/{project}`. - # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1::Assessment, ::Hash] - # Required. The assessment details. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new - # - # # Call the create_assessment method. - # result = client.create_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. - # p result - # - def create_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest - - # Converts hash and nil to 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_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_assessment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Annotates a previously created Assessment to provide additional information - # on whether the event turned out to be authentic or fraudulent. - # - # @overload annotate_assessment(request, options = nil) - # Pass arguments to `annotate_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, account_id: nil, hashed_account_id: nil, transaction_event: nil, phone_authentication_event: nil) - # Pass arguments to `annotate_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Assessment, in the format - # `projects/{project}/assessments/{assessment}`. - # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation] - # Optional. The annotation that is assigned to the Event. This field can be - # left empty to provide reasons that apply to an event without concluding - # whether the event is legitimate or fraudulent. - # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>] - # Optional. Reasons for the annotation that are assigned to the event. - # @param account_id [::String] - # Optional. A stable account identifier to apply to the assessment. This is - # an alternative to setting `account_id` in `CreateAssessment`, for example - # when a stable account identifier is not yet known in the initial request. - # @param hashed_account_id [::String] - # Optional. A stable hashed account identifier to apply to the assessment. - # This is an alternative to setting `hashed_account_id` in - # `CreateAssessment`, for example when a stable account identifier is not yet - # known in the initial request. - # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent, ::Hash] - # Optional. If the assessment is part of a payment transaction, provide - # details on payment lifecycle events that occur in the transaction. - # @param phone_authentication_event [::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent, ::Hash] - # Optional. If using an external multi-factor authentication provider, - # provide phone authentication details for fraud detection purposes. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new - # - # # Call the annotate_assessment method. - # result = client.annotate_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. - # p result - # - def annotate_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.annotate_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.annotate_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, 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 reCAPTCHA Enterprise key. - # - # @overload create_key(request, options = nil) - # Pass arguments to `create_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_key(parent: nil, key: nil) - # Pass arguments to `create_key` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project in which the key is created, in the - # format `projects/{project}`. - # @param key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash] - # Required. Information to create a reCAPTCHA Enterprise key. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new - # - # # Call the create_key method. - # result = client.create_key request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - # p result - # - def create_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest - - # Converts hash and nil to 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_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :create_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 - - ## - # Returns the list of all keys that belong to a project. - # - # @overload list_keys(request, options = nil) - # Pass arguments to `list_keys` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_keys(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_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 name of the project that contains the keys that is - # listed, in the format `projects/{project}`. - # @param page_size [::Integer] - # Optional. The maximum number of keys to return. Default is 10. Max limit is - # 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous. - # ListKeysRequest, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new - # - # # Call the list_keys method. - # result = client.list_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::RecaptchaEnterprise::V1::Key. - # p item - # end - # - def list_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_keys.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_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 - - ## - # Returns the secret key related to the specified public key. - # You must use the legacy secret key only in a 3rd party integration with - # legacy reCAPTCHA. - # - # @overload retrieve_legacy_secret_key(request, options = nil) - # Pass arguments to `retrieve_legacy_secret_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload retrieve_legacy_secret_key(key: nil) - # Pass arguments to `retrieve_legacy_secret_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 key [::String] - # Required. The public key name linked to the requested secret key in the - # format `projects/{project}/keys/{key}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new - # - # # Call the retrieve_legacy_secret_key method. - # result = client.retrieve_legacy_secret_key request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. - # p result - # - def retrieve_legacy_secret_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.retrieve_legacy_secret_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.key - header_params["key"] = request.key - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.retrieve_legacy_secret_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.retrieve_legacy_secret_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :retrieve_legacy_secret_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 - - ## - # Returns the specified key. - # - # @overload get_key(request, options = nil) - # Pass arguments to `get_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_key(name: nil) - # Pass arguments to `get_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 name of the requested key, in the format - # `projects/{project}/keys/{key}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new - # - # # Call the get_key method. - # result = client.get_key request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - # p result - # - def get_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :get_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 - - ## - # Updates the specified key. - # - # @overload update_key(request, options = nil) - # Pass arguments to `update_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_key(key: nil, update_mask: nil) - # Pass arguments to `update_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 key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash] - # Required. The key to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields of the key get updated. If the - # mask is not present, all fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new - # - # # Call the update_key method. - # result = client.update_key request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - # p result - # - def update_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest - - # Converts hash and nil to 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_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.key&.name - header_params["key.name"] = request.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_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :update_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 - - ## - # Deletes the specified key. - # - # @overload delete_key(request, options = nil) - # Pass arguments to `delete_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_key(name: nil) - # Pass arguments to `delete_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 name of the key to be deleted, in the format - # `projects/{project}/keys/{key}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new - # - # # Call the delete_key method. - # result = client.delete_key request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :delete_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 - - ## - # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. - # Once a key is migrated, it can be used from either product. SiteVerify - # requests are billed as CreateAssessment calls. You must be - # authenticated as one of the current owners of the reCAPTCHA Key, and - # your user must have the reCAPTCHA Enterprise Admin IAM role in the - # destination project. - # - # @overload migrate_key(request, options = nil) - # Pass arguments to `migrate_key` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload migrate_key(name: nil, skip_billing_check: nil) - # Pass arguments to `migrate_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 name of the key to be migrated, in the format - # `projects/{project}/keys/{key}`. - # @param skip_billing_check [::Boolean] - # Optional. If true, skips the billing check. - # A reCAPTCHA Enterprise key or migrated key behaves differently than a - # reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - # https://docs.cloud.google.com/recaptcha/quotas#quota_limit). To avoid - # any disruption of your usage, we check that a billing account is present. - # If your usage of reCAPTCHA is under the free quota, you can safely skip the - # billing check and proceed with the migration. See - # https://cloud.google.com/recaptcha/docs/billing-information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new - # - # # Call the migrate_key method. - # result = client.migrate_key request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - # p result - # - def migrate_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.migrate_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.migrate_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.migrate_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :migrate_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 - - ## - # Adds an IP override to a key. The following restrictions hold: - # * The maximum number of IP overrides per key is 1000. - # * For any conflict (such as IP already exists or IP part of an existing - # IP range), an error is returned. - # - # @overload add_ip_override(request, options = nil) - # Pass arguments to `add_ip_override` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ip_override(name: nil, ip_override_data: nil) - # Pass arguments to `add_ip_override` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 key to which the IP override is added, in the - # format `projects/{project}/keys/{key}`. - # @param ip_override_data [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData, ::Hash] - # Required. IP override added to the key. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new - # - # # Call the add_ip_override method. - # result = client.add_ip_override request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse. - # p result - # - def add_ip_override request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest - - # Converts hash and nil to 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_ip_override.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_ip_override.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_ip_override.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :add_ip_override, request, 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 an IP override from a key. The following restrictions hold: - # * If the IP isn't found in an existing IP override, a `NOT_FOUND` error - # is returned. - # * If the IP is found in an existing IP override, but the - # override type does not match, a `NOT_FOUND` error is returned. - # - # @overload remove_ip_override(request, options = nil) - # Pass arguments to `remove_ip_override` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_ip_override(name: nil, ip_override_data: nil) - # Pass arguments to `remove_ip_override` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 key from which the IP override is removed, in the - # format `projects/{project}/keys/{key}`. - # @param ip_override_data [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData, ::Hash] - # Required. IP override to be removed from the key. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new - # - # # Call the remove_ip_override method. - # result = client.remove_ip_override request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse. - # p result - # - def remove_ip_override request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest - - # Converts hash and nil to 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_ip_override.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_ip_override.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_ip_override.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :remove_ip_override, request, 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 IP overrides for a key. - # - # @overload list_ip_overrides(request, options = nil) - # Pass arguments to `list_ip_overrides` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_ip_overrides(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_ip_overrides` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 key for which the IP overrides are listed, in the - # format `projects/{project}/keys/{key}`. - # @param page_size [::Integer] - # Optional. The maximum number of overrides to return. Default is 10. Max - # limit is 100. If the number of overrides is less than the page_size, all - # overrides are returned. If the page size is more than 100, it is coerced to - # 100. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous - # ListIpOverridesRequest, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.new - # - # # Call the list_ip_overrides method. - # result = client.list_ip_overrides request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData. - # p item - # end - # - def list_ip_overrides request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_ip_overrides.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_ip_overrides.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_ip_overrides.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :list_ip_overrides, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_ip_overrides, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get some aggregated metrics for a Key. This data can be used to build - # dashboards. - # - # @overload get_metrics(request, options = nil) - # Pass arguments to `get_metrics` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_metrics(name: nil) - # Pass arguments to `get_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 name [::String] - # Required. The name of the requested metrics, in the format - # `projects/{project}/keys/{key}/metrics`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Metrics] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Metrics] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new - # - # # Call the get_metrics method. - # result = client.get_metrics request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. - # p result - # - def get_metrics request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_metrics.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_metrics.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :get_metrics, request, 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 FirewallPolicy, specifying conditions at which reCAPTCHA - # Enterprise actions can be executed. - # A project may have a maximum of 1000 policies. - # - # @overload create_firewall_policy(request, options = nil) - # Pass arguments to `create_firewall_policy` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_firewall_policy(parent: nil, firewall_policy: nil) - # Pass arguments to `create_firewall_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project this policy applies to, in the format - # `projects/{project}`. - # @param firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash] - # Required. Information to create the policy. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new - # - # # Call the create_firewall_policy method. - # result = client.create_firewall_policy request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - # p result - # - def create_firewall_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest - - # Converts hash and nil to 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_firewall_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_firewall_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_firewall_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :create_firewall_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 list of all firewall policies that belong to a project. - # - # @overload list_firewall_policies(request, options = nil) - # Pass arguments to `list_firewall_policies` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_firewall_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_firewall_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project to list the policies for, in the format - # `projects/{project}`. - # @param page_size [::Integer] - # Optional. The maximum number of policies to return. Default is 10. Max - # limit is 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous. - # ListFirewallPoliciesRequest, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.new - # - # # Call the list_firewall_policies method. - # result = client.list_firewall_policies request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - # p item - # end - # - def list_firewall_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_firewall_policies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_firewall_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_firewall_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :list_firewall_policies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_firewall_policies, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified firewall policy. - # - # @overload get_firewall_policy(request, options = nil) - # Pass arguments to `get_firewall_policy` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_firewall_policy(name: nil) - # Pass arguments to `get_firewall_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the requested policy, in the format - # `projects/{project}/firewallpolicies/{firewallpolicy}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new - # - # # Call the get_firewall_policy method. - # result = client.get_firewall_policy request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - # p result - # - def get_firewall_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_firewall_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_firewall_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_firewall_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :get_firewall_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified firewall policy. - # - # @overload update_firewall_policy(request, options = nil) - # Pass arguments to `update_firewall_policy` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_firewall_policy(firewall_policy: nil, update_mask: nil) - # Pass arguments to `update_firewall_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 firewall_policy [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy, ::Hash] - # Required. The policy to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields of the policy get updated. If - # the mask is not present, all fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new - # - # # Call the update_firewall_policy method. - # result = client.update_firewall_policy request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - # p result - # - def update_firewall_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest - - # Converts hash and nil to 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_firewall_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.firewall_policy&.name - header_params["firewall_policy.name"] = request.firewall_policy.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_firewall_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_firewall_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :update_firewall_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 - - ## - # Deletes the specified firewall policy. - # - # @overload delete_firewall_policy(request, options = nil) - # Pass arguments to `delete_firewall_policy` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_firewall_policy(name: nil) - # Pass arguments to `delete_firewall_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the policy to be deleted, in the format - # `projects/{project}/firewallpolicies/{firewallpolicy}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new - # - # # Call the delete_firewall_policy method. - # result = client.delete_firewall_policy request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_firewall_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_firewall_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::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_firewall_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_firewall_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :delete_firewall_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 - - ## - # Reorders all firewall policies. - # - # @overload reorder_firewall_policies(request, options = nil) - # Pass arguments to `reorder_firewall_policies` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reorder_firewall_policies(parent: nil, names: nil) - # Pass arguments to `reorder_firewall_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the project to list the policies for, in the format - # `projects/{project}`. - # @param names [::Array<::String>] - # Required. A list containing all policy names, in the new order. Each name - # is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new - # - # # Call the reorder_firewall_policies method. - # result = client.reorder_firewall_policies request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse. - # p result - # - def reorder_firewall_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.reorder_firewall_policies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.reorder_firewall_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reorder_firewall_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :reorder_firewall_policies, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List groups of related accounts. - # - # @overload list_related_account_groups(request, options = nil) - # Pass arguments to `list_related_account_groups` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_related_account_groups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_related_account_groups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 project to list related account groups from, in - # the format `projects/{project}`. - # @param page_size [::Integer] - # Optional. The maximum number of groups to return. The service might return - # fewer than this value. If unspecified, at most 50 groups are returned. The - # maximum value is 1000; values above 1000 are coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListRelatedAccountGroups` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListRelatedAccountGroups` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new - # - # # Call the list_related_account_groups method. - # result = client.list_related_account_groups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. - # p item - # end - # - def list_related_account_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_related_account_groups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_related_account_groups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_related_account_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :list_related_account_groups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_groups, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get memberships in a group of related accounts. - # - # @overload list_related_account_group_memberships(request, options = nil) - # Pass arguments to `list_related_account_group_memberships` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_related_account_group_memberships(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_related_account_group_memberships` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name for the related account group in the format - # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - # @param page_size [::Integer] - # Optional. The maximum number of accounts to return. The service might - # return fewer than this value. If unspecified, at most 50 accounts are - # returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `ListRelatedAccountGroupMemberships` call. - # - # When paginating, all other parameters provided to - # `ListRelatedAccountGroupMemberships` must match the call that provided the - # page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new - # - # # Call the list_related_account_group_memberships method. - # result = client.list_related_account_group_memberships request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - # p item - # end - # - def list_related_account_group_memberships request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_related_account_group_memberships.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_related_account_group_memberships.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_related_account_group_memberships.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :list_related_account_group_memberships, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_group_memberships, request, response, 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 group memberships related to a given account. - # - # @overload search_related_account_group_memberships(request, options = nil) - # Pass arguments to `search_related_account_group_memberships` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_related_account_group_memberships(project: nil, account_id: nil, hashed_account_id: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_related_account_group_memberships` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the project to search related account group - # memberships from. Specify the project name in the following format: - # `projects/{project}`. - # @param account_id [::String] - # Optional. The unique stable account identifier used to search connections. - # The identifier should correspond to an `account_id` provided in a previous - # `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - # or account_id must be set, but not both. - # @param hashed_account_id [::String] - # Optional. Deprecated: use `account_id` instead. - # The unique stable hashed account identifier used to search connections. The - # identifier should correspond to a `hashed_account_id` provided in a - # previous `CreateAssessment` or `AnnotateAssessment` call. Either - # hashed_account_id or account_id must be set, but not both. - # @param page_size [::Integer] - # Optional. The maximum number of groups to return. The service might return - # fewer than this value. If unspecified, at most 50 groups are returned. The - # maximum value is 1000; values above 1000 are coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `SearchRelatedAccountGroupMemberships` must match the call that provided - # the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new - # - # # Call the search_related_account_group_memberships method. - # result = client.search_related_account_group_memberships request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - # p item - # end - # - def search_related_account_group_memberships request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest - - # Converts hash and nil to 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_related_account_group_memberships.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION - metadata[:"x-goog-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 - header_params["project"] = request.project - end - - request_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_related_account_group_memberships.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_related_account_group_memberships.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :search_related_account_group_memberships, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :search_related_account_group_memberships, request, response, 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 RecaptchaEnterpriseService API. - # - # This class represents the configuration for RecaptchaEnterpriseService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_assessment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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 = "recaptchaenterprise.googleapis.com" - - config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_assessment - ## - # RPC-specific configuration for `annotate_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :annotate_assessment - ## - # RPC-specific configuration for `create_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_key - ## - # RPC-specific configuration for `list_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_keys - ## - # RPC-specific configuration for `retrieve_legacy_secret_key` - # @return [::Gapic::Config::Method] - # - attr_reader :retrieve_legacy_secret_key - ## - # RPC-specific configuration for `get_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_key - ## - # RPC-specific configuration for `update_key` - # @return [::Gapic::Config::Method] - # - attr_reader :update_key - ## - # RPC-specific configuration for `delete_key` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_key - ## - # RPC-specific configuration for `migrate_key` - # @return [::Gapic::Config::Method] - # - attr_reader :migrate_key - ## - # RPC-specific configuration for `add_ip_override` - # @return [::Gapic::Config::Method] - # - attr_reader :add_ip_override - ## - # RPC-specific configuration for `remove_ip_override` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_ip_override - ## - # RPC-specific configuration for `list_ip_overrides` - # @return [::Gapic::Config::Method] - # - attr_reader :list_ip_overrides - ## - # RPC-specific configuration for `get_metrics` - # @return [::Gapic::Config::Method] - # - attr_reader :get_metrics - ## - # RPC-specific configuration for `create_firewall_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_firewall_policy - ## - # RPC-specific configuration for `list_firewall_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_firewall_policies - ## - # RPC-specific configuration for `get_firewall_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_firewall_policy - ## - # RPC-specific configuration for `update_firewall_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_firewall_policy - ## - # RPC-specific configuration for `delete_firewall_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_firewall_policy - ## - # RPC-specific configuration for `reorder_firewall_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :reorder_firewall_policies - ## - # RPC-specific configuration for `list_related_account_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_related_account_groups - ## - # RPC-specific configuration for `list_related_account_group_memberships` - # @return [::Gapic::Config::Method] - # - attr_reader :list_related_account_group_memberships - ## - # RPC-specific configuration for `search_related_account_group_memberships` - # @return [::Gapic::Config::Method] - # - attr_reader :search_related_account_group_memberships - - # @private - def initialize parent_rpcs = nil - create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment - @create_assessment = ::Gapic::Config::Method.new create_assessment_config - annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment - @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config - create_key_config = parent_rpcs.create_key if parent_rpcs.respond_to? :create_key - @create_key = ::Gapic::Config::Method.new create_key_config - list_keys_config = parent_rpcs.list_keys if parent_rpcs.respond_to? :list_keys - @list_keys = ::Gapic::Config::Method.new list_keys_config - retrieve_legacy_secret_key_config = parent_rpcs.retrieve_legacy_secret_key if parent_rpcs.respond_to? :retrieve_legacy_secret_key - @retrieve_legacy_secret_key = ::Gapic::Config::Method.new retrieve_legacy_secret_key_config - get_key_config = parent_rpcs.get_key if parent_rpcs.respond_to? :get_key - @get_key = ::Gapic::Config::Method.new get_key_config - update_key_config = parent_rpcs.update_key if parent_rpcs.respond_to? :update_key - @update_key = ::Gapic::Config::Method.new update_key_config - delete_key_config = parent_rpcs.delete_key if parent_rpcs.respond_to? :delete_key - @delete_key = ::Gapic::Config::Method.new delete_key_config - migrate_key_config = parent_rpcs.migrate_key if parent_rpcs.respond_to? :migrate_key - @migrate_key = ::Gapic::Config::Method.new migrate_key_config - add_ip_override_config = parent_rpcs.add_ip_override if parent_rpcs.respond_to? :add_ip_override - @add_ip_override = ::Gapic::Config::Method.new add_ip_override_config - remove_ip_override_config = parent_rpcs.remove_ip_override if parent_rpcs.respond_to? :remove_ip_override - @remove_ip_override = ::Gapic::Config::Method.new remove_ip_override_config - list_ip_overrides_config = parent_rpcs.list_ip_overrides if parent_rpcs.respond_to? :list_ip_overrides - @list_ip_overrides = ::Gapic::Config::Method.new list_ip_overrides_config - get_metrics_config = parent_rpcs.get_metrics if parent_rpcs.respond_to? :get_metrics - @get_metrics = ::Gapic::Config::Method.new get_metrics_config - create_firewall_policy_config = parent_rpcs.create_firewall_policy if parent_rpcs.respond_to? :create_firewall_policy - @create_firewall_policy = ::Gapic::Config::Method.new create_firewall_policy_config - list_firewall_policies_config = parent_rpcs.list_firewall_policies if parent_rpcs.respond_to? :list_firewall_policies - @list_firewall_policies = ::Gapic::Config::Method.new list_firewall_policies_config - get_firewall_policy_config = parent_rpcs.get_firewall_policy if parent_rpcs.respond_to? :get_firewall_policy - @get_firewall_policy = ::Gapic::Config::Method.new get_firewall_policy_config - update_firewall_policy_config = parent_rpcs.update_firewall_policy if parent_rpcs.respond_to? :update_firewall_policy - @update_firewall_policy = ::Gapic::Config::Method.new update_firewall_policy_config - delete_firewall_policy_config = parent_rpcs.delete_firewall_policy if parent_rpcs.respond_to? :delete_firewall_policy - @delete_firewall_policy = ::Gapic::Config::Method.new delete_firewall_policy_config - reorder_firewall_policies_config = parent_rpcs.reorder_firewall_policies if parent_rpcs.respond_to? :reorder_firewall_policies - @reorder_firewall_policies = ::Gapic::Config::Method.new reorder_firewall_policies_config - list_related_account_groups_config = parent_rpcs.list_related_account_groups if parent_rpcs.respond_to? :list_related_account_groups - @list_related_account_groups = ::Gapic::Config::Method.new list_related_account_groups_config - list_related_account_group_memberships_config = parent_rpcs.list_related_account_group_memberships if parent_rpcs.respond_to? :list_related_account_group_memberships - @list_related_account_group_memberships = ::Gapic::Config::Method.new list_related_account_group_memberships_config - search_related_account_group_memberships_config = parent_rpcs.search_related_account_group_memberships if parent_rpcs.respond_to? :search_related_account_group_memberships - @search_related_account_group_memberships = ::Gapic::Config::Method.new search_related_account_group_memberships_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials.rb deleted file mode 100644 index 5bad44dfdcb2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_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 RecaptchaEnterprise - module V1 - module RecaptchaEnterpriseService - # Credentials for the RecaptchaEnterpriseService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECAPTCHA_ENTERPRISE_CREDENTIALS", - "RECAPTCHA_ENTERPRISE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON", - "RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb deleted file mode 100644 index 7a41dbacecdb..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/paths.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecaptchaEnterprise - module V1 - module RecaptchaEnterpriseService - # Path helper methods for the RecaptchaEnterpriseService API. - module Paths - ## - # Create a fully-qualified Assessment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/assessments/{assessment}` - # - # @param project [String] - # @param assessment [String] - # - # @return [::String] - def assessment_path project:, assessment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/assessments/#{assessment}" - end - - ## - # Create a fully-qualified FirewallPolicy resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/firewallpolicies/{firewallpolicy}` - # - # @param project [String] - # @param firewallpolicy [String] - # - # @return [::String] - def firewall_policy_path project:, firewallpolicy: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/firewallpolicies/#{firewallpolicy}" - end - - ## - # Create a fully-qualified Key resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/keys/{key}` - # - # @param project [String] - # @param key [String] - # - # @return [::String] - def key_path project:, key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/keys/#{key}" - end - - ## - # Create a fully-qualified Metrics resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/keys/{key}/metrics` - # - # @param project [String] - # @param key [String] - # - # @return [::String] - def metrics_path project:, key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/keys/#{key}/metrics" - 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 RelatedAccountGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}` - # - # @param project [String] - # @param relatedaccountgroup [String] - # - # @return [::String] - def related_account_group_path project:, relatedaccountgroup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/relatedaccountgroups/#{relatedaccountgroup}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/v1/version.rb deleted file mode 100644 index 6d793f226301..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb deleted file mode 100644 index 2419a56f15fc..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb +++ /dev/null @@ -1,161 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n=google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto\x12#google.cloud.recaptchaenterprise.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa8\x01\n\x17\x43reateAssessmentRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12H\n\nassessment\x18\x02 \x01(\x0b\x32/.google.cloud.recaptchaenterprise.v1.AssessmentB\x03\xe0\x41\x02\"\x92\x05\n\x10TransactionEvent\x12\x63\n\nevent_type\x18\x01 \x01(\x0e\x32J.google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventTypeB\x03\xe0\x41\x01\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xba\x03\n\x14TransactionEventType\x12&\n\"TRANSACTION_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10MERCHANT_APPROVE\x10\x01\x12\x11\n\rMERCHANT_DENY\x10\x02\x12\x11\n\rMANUAL_REVIEW\x10\x03\x12\x11\n\rAUTHORIZATION\x10\x04\x12\x19\n\x15\x41UTHORIZATION_DECLINE\x10\x05\x12\x13\n\x0fPAYMENT_CAPTURE\x10\x06\x12\x1b\n\x17PAYMENT_CAPTURE_DECLINE\x10\x07\x12\n\n\x06\x43\x41NCEL\x10\x08\x12\x16\n\x12\x43HARGEBACK_INQUIRY\x10\t\x12\x14\n\x10\x43HARGEBACK_ALERT\x10\n\x12\x16\n\x12\x46RAUD_NOTIFICATION\x10\x0b\x12\x0e\n\nCHARGEBACK\x10\x0c\x12\x1c\n\x18\x43HARGEBACK_REPRESENTMENT\x10\r\x12\x16\n\x12\x43HARGEBACK_REVERSE\x10\x0e\x12\x12\n\x0eREFUND_REQUEST\x10\x0f\x12\x12\n\x0eREFUND_DECLINE\x10\x10\x12\n\n\x06REFUND\x10\x11\x12\x12\n\x0eREFUND_REVERSE\x10\x12\"j\n\x18PhoneAuthenticationEvent\x12\x19\n\x0cphone_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\nevent_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xeb\x07\n\x19\x41nnotateAssessmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recaptchaenterprise.googleapis.com/Assessment\x12\x62\n\nannotation\x18\x02 \x01(\x0e\x32I.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.AnnotationB\x03\xe0\x41\x01\x12[\n\x07reasons\x18\x03 \x03(\x0e\x32\x45.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.ReasonB\x03\xe0\x41\x01\x12\x17\n\naccount_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x01\x12U\n\x11transaction_event\x18\x05 \x01(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.TransactionEventB\x03\xe0\x41\x01\x12\x66\n\x1aphone_authentication_event\x18\x06 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEventB\x03\xe0\x41\x01\"~\n\nAnnotation\x12\x1a\n\x16\x41NNOTATION_UNSPECIFIED\x10\x00\x12\x0e\n\nLEGITIMATE\x10\x01\x12\x0e\n\nFRAUDULENT\x10\x02\x12\x18\n\x10PASSWORD_CORRECT\x10\x03\x1a\x02\x08\x01\x12\x1a\n\x12PASSWORD_INCORRECT\x10\x04\x1a\x02\x08\x01\"\xcf\x02\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nCHARGEBACK\x10\x01\x12\x14\n\x10\x43HARGEBACK_FRAUD\x10\x08\x12\x16\n\x12\x43HARGEBACK_DISPUTE\x10\t\x12\n\n\x06REFUND\x10\n\x12\x10\n\x0cREFUND_FRAUD\x10\x0b\x12\x18\n\x14TRANSACTION_ACCEPTED\x10\x0c\x12\x18\n\x14TRANSACTION_DECLINED\x10\r\x12\x16\n\x12PAYMENT_HEURISTICS\x10\x02\x12\x18\n\x14INITIATED_TWO_FACTOR\x10\x07\x12\x15\n\x11PASSED_TWO_FACTOR\x10\x03\x12\x15\n\x11\x46\x41ILED_TWO_FACTOR\x10\x04\x12\x14\n\x10\x43ORRECT_PASSWORD\x10\x05\x12\x16\n\x12INCORRECT_PASSWORD\x10\x06\x12\x0f\n\x0bSOCIAL_SPAM\x10\x0e\"\x1c\n\x1a\x41nnotateAssessmentResponse\"\xb4\x01\n\x18\x45ndpointVerificationInfo\x12\x17\n\remail_address\x18\x01 \x01(\tH\x00\x12\x16\n\x0cphone_number\x18\x02 \x01(\tH\x00\x12\x1a\n\rrequest_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x16last_verification_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\n\n\x08\x65ndpoint\"\xdb\x04\n\x17\x41\x63\x63ountVerificationInfo\x12U\n\tendpoints\x18\x01 \x03(\x0b\x32=.google.cloud.recaptchaenterprise.v1.EndpointVerificationInfoB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12l\n\x1alatest_verification_result\x18\x07 \x01(\x0e\x32\x43.google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.ResultB\x03\xe0\x41\x03\x12\x14\n\x08username\x18\x02 \x01(\tB\x02\x18\x01\"\xc8\x02\n\x06Result\x12\x16\n\x12RESULT_UNSPECIFIED\x10\x00\x12\x19\n\x15SUCCESS_USER_VERIFIED\x10\x01\x12\x1b\n\x17\x45RROR_USER_NOT_VERIFIED\x10\x02\x12$\n ERROR_SITE_ONBOARDING_INCOMPLETE\x10\x03\x12\x1f\n\x1b\x45RROR_RECIPIENT_NOT_ALLOWED\x10\x04\x12)\n%ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED\x10\x05\x12\x1b\n\x17\x45RROR_CRITICAL_INTERNAL\x10\x06\x12\"\n\x1e\x45RROR_CUSTOMER_QUOTA_EXHAUSTED\x10\x07\x12\x1f\n\x1b\x45RROR_VERIFICATION_BYPASSED\x10\x08\x12\x1a\n\x16\x45RROR_VERDICT_MISMATCH\x10\t\"\xcc\x01\n\x1fPrivatePasswordLeakVerification\x12\x1f\n\x12lookup_hash_prefix\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12,\n\x1f\x65ncrypted_user_credentials_hash\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x12*\n\x1d\x65ncrypted_leak_match_prefixes\x18\x03 \x03(\x0c\x42\x03\xe0\x41\x03\x12.\n!reencrypted_user_credentials_hash\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x03\"\xa4\t\n\nAssessment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12>\n\x05\x65vent\x18\x02 \x01(\x0b\x32*.google.cloud.recaptchaenterprise.v1.EventB\x03\xe0\x41\x01\x12M\n\rrisk_analysis\x18\x03 \x01(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.RiskAnalysisB\x03\xe0\x41\x03\x12S\n\x10token_properties\x18\x04 \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.TokenPropertiesB\x03\xe0\x41\x03\x12_\n\x14\x61\x63\x63ount_verification\x18\x05 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.AccountVerificationInfoB\x03\xe0\x41\x01\x12h\n\x1b\x61\x63\x63ount_defender_assessment\x18\x06 \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessmentB\x03\xe0\x41\x03\x12u\n\"private_password_leak_verification\x18\x08 \x01(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerificationB\x03\xe0\x41\x01\x12\x66\n\x1a\x66irewall_policy_assessment\x18\n \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessmentB\x03\xe0\x41\x03\x12h\n\x1b\x66raud_prevention_assessment\x18\x0b \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessmentB\x03\xe0\x41\x03\x12M\n\rfraud_signals\x18\r \x01(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.FraudSignalsB\x03\xe0\x41\x03\x12^\n\x16phone_fraud_assessment\x18\x0c \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessmentB\x03\xe0\x41\x03\x12_\n\x16\x61ssessment_environment\x18\x0e \x01(\x0b\x32:.google.cloud.recaptchaenterprise.v1.AssessmentEnvironmentB\x03\xe0\x41\x01:x\xea\x41u\n-recaptchaenterprise.googleapis.com/Assessment\x12+projects/{project}/assessments/{assessment}*\x0b\x61ssessments2\nassessment\"\xb0\x05\n\x05\x45vent\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08site_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12$\n\x0fuser_ip_address\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\x1c\n\x0f\x65xpected_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x11hashed_account_id\x18\x06 \x01(\x0c\x42\x05\x18\x01\xe0\x41\x01\x12\x14\n\x07\x65xpress\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rrequested_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14waf_token_assessment\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12\x10\n\x03ja3\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03ja4\x18\x12 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07headers\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\'\n\x1a\x66irewall_policy_evaluation\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\x10transaction_data\x18\r \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.TransactionDataB\x03\xe0\x41\x01\x12\x45\n\tuser_info\x18\x0f \x01(\x0b\x32-.google.cloud.recaptchaenterprise.v1.UserInfoB\x03\xe0\x41\x01\x12Y\n\x10\x66raud_prevention\x18\x11 \x01(\x0e\x32:.google.cloud.recaptchaenterprise.v1.Event.FraudPreventionB\x03\xe0\x41\x01\"N\n\x0f\x46raudPrevention\x12 \n\x1c\x46RAUD_PREVENTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\xa0\n\n\x0fTransactionData\x12\x1b\n\x0etransaction_id\x18\x0b \x01(\tH\x00\x88\x01\x01\x12\x1b\n\x0epayment_method\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x63\x61rd_bin\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x63\x61rd_last_four\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x05 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0eshipping_value\x18\x0c \x01(\x01\x42\x03\xe0\x41\x01\x12[\n\x10shipping_address\x18\x06 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.TransactionData.AddressB\x03\xe0\x41\x01\x12Z\n\x0f\x62illing_address\x18\x07 \x01(\x0b\x32<.google.cloud.recaptchaenterprise.v1.TransactionData.AddressB\x03\xe0\x41\x01\x12L\n\x04user\x18\x08 \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.UserB\x03\xe0\x41\x01\x12Q\n\tmerchants\x18\r \x03(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.UserB\x03\xe0\x41\x01\x12M\n\x05items\x18\x0e \x03(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1.TransactionData.ItemB\x03\xe0\x41\x01\x12[\n\x0cgateway_info\x18\n \x01(\x0b\x32@.google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfoB\x03\xe0\x41\x01\x1a\xa4\x01\n\x07\x41\x64\x64ress\x12\x16\n\trecipient\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08locality\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x61\x64ministrative_area\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bregion_code\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bpostal_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1a\xa2\x01\n\x04User\x12\x17\n\naccount_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63reation_ms\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x12\n\x05\x65mail\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65mail_verified\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0cphone_number\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ephone_verified\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x66\n\x04Item\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x15\n\x08quantity\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01\x12 \n\x13merchant_account_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x84\x01\n\x0bGatewayInfo\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15gateway_response_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x61vs_response_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x63vv_response_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x42\x11\n\x0f_transaction_id\"\xa5\x01\n\x08UserInfo\x12<\n\x13\x63reate_account_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x17\n\naccount_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\x08user_ids\x18\x03 \x03(\x0b\x32+.google.cloud.recaptchaenterprise.v1.UserIdB\x03\xe0\x41\x01\"`\n\x06UserId\x12\x14\n\x05\x65mail\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x1b\n\x0cphone_number\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x17\n\x08username\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x42\n\n\x08id_oneof\"\xfd\x04\n\x0cRiskAnalysis\x12\x12\n\x05score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\\\n\x07reasons\x18\x02 \x03(\x0e\x32\x46.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReasonB\x03\xe0\x41\x03\x12%\n\x18\x65xtended_verdict_reasons\x18\x03 \x03(\tB\x03\xe0\x41\x03\x12S\n\tchallenge\x18\x04 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ChallengeB\x03\xe0\x41\x03\x12\x44\n\rverified_bots\x18\x05 \x03(\x0b\x32(.google.cloud.recaptchaenterprise.v1.BotB\x03\xe0\x41\x03\"\xe9\x01\n\x14\x43lassificationReason\x12%\n!CLASSIFICATION_REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nAUTOMATION\x10\x01\x12\x1a\n\x16UNEXPECTED_ENVIRONMENT\x10\x02\x12\x14\n\x10TOO_MUCH_TRAFFIC\x10\x03\x12\x1d\n\x19UNEXPECTED_USAGE_PATTERNS\x10\x04\x12\x18\n\x14LOW_CONFIDENCE_SCORE\x10\x05\x12\x15\n\x11SUSPECTED_CARDING\x10\x06\x12\x18\n\x14SUSPECTED_CHARGEBACK\x10\x07\"M\n\tChallenge\x12\x19\n\x15\x43HALLENGE_UNSPECIFIED\x10\x00\x12\r\n\tNOCAPTCHA\x10\x01\x12\n\n\x06PASSED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"\xbd\x01\n\x03\x42ot\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12G\n\x08\x62ot_type\x18\x02 \x01(\x0e\x32\x30.google.cloud.recaptchaenterprise.v1.Bot.BotTypeB\x03\xe0\x41\x01\"Z\n\x07\x42otType\x12\x18\n\x14\x42OT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41I_AGENT\x10\x01\x12\x13\n\x0f\x43ONTENT_SCRAPER\x10\x02\x12\x12\n\x0eSEARCH_INDEXER\x10\x03\"\xd2\x03\n\x0fTokenProperties\x12\x12\n\x05valid\x18\x01 \x01(\x08\x42\x03\xe0\x41\x03\x12_\n\x0einvalid_reason\x18\x02 \x01(\x0e\x32\x42.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReasonB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08hostname\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12!\n\x14\x61ndroid_package_name\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rios_bundle_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06\x61\x63tion\x18\x05 \x01(\tB\x03\xe0\x41\x03\"\xa8\x01\n\rInvalidReason\x12\x1e\n\x1aINVALID_REASON_UNSPECIFIED\x10\x00\x12\x1a\n\x16UNKNOWN_INVALID_REASON\x10\x01\x12\r\n\tMALFORMED\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03\x12\x08\n\x04\x44UPE\x10\x04\x12\x0b\n\x07MISSING\x10\x05\x12\x11\n\rBROWSER_ERROR\x10\x06\x12\x15\n\x11UNEXPECTED_ACTION\x10\x07\"\xd0\x07\n\x19\x46raudPreventionAssessment\x12\x1d\n\x10transaction_risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x64\n\x0crisk_reasons\x18\x06 \x03(\x0b\x32I.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReasonB\x03\xe0\x41\x03\x12~\n\x19stolen_instrument_verdict\x18\x02 \x01(\x0b\x32V.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdictB\x03\xe0\x41\x03\x12t\n\x14\x63\x61rd_testing_verdict\x18\x03 \x01(\x0b\x32Q.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdictB\x03\xe0\x41\x03\x12|\n\x18\x62\x65havioral_trust_verdict\x18\x04 \x01(\x0b\x32U.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdictB\x03\xe0\x41\x03\x1a\xb4\x02\n\nRiskReason\x12\x65\n\x06reason\x18\x01 \x01(\x0e\x32P.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason.ReasonB\x03\xe0\x41\x03\"\xbe\x01\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19HIGH_TRANSACTION_VELOCITY\x10\x01\x12!\n\x1d\x45XCESSIVE_ENUMERATION_PATTERN\x10\x02\x12\x1a\n\x16SHORT_IDENTITY_HISTORY\x10\x03\x12\x1b\n\x17GEOLOCATION_DISCREPANCY\x10\x04\x12!\n\x1d\x41SSOCIATED_WITH_FRAUD_CLUSTER\x10\x05\x1a,\n\x17StolenInstrumentVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a\'\n\x12\x43\x61rdTestingVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a,\n\x16\x42\x65havioralTrustVerdict\x12\x12\n\x05trust\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\"\xe3\x03\n\x0c\x46raudSignals\x12X\n\x0cuser_signals\x18\x01 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignalsB\x03\xe0\x41\x03\x12X\n\x0c\x63\x61rd_signals\x18\x02 \x01(\x0b\x32=.google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignalsB\x03\xe0\x41\x03\x1aP\n\x0bUserSignals\x12$\n\x17\x61\x63tive_days_lower_bound\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1b\n\x0esynthetic_risk\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03\x1a\xcc\x01\n\x0b\x43\x61rdSignals\x12\x61\n\x0b\x63\x61rd_labels\x18\x01 \x03(\x0e\x32G.google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabelB\x03\xe0\x41\x03\"Z\n\tCardLabel\x12\x1a\n\x16\x43\x41RD_LABEL_UNSPECIFIED\x10\x00\x12\x0b\n\x07PREPAID\x10\x01\x12\x0b\n\x07VIRTUAL\x10\x02\x12\x17\n\x13UNEXPECTED_LOCATION\x10\x03\"\xe2\x01\n\x13SmsTollFraudVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x61\n\x07reasons\x18\x02 \x03(\x0e\x32K.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReasonB\x03\xe0\x41\x03\"U\n\x12SmsTollFraudReason\x12%\n!SMS_TOLL_FRAUD_REASON_UNSPECIFIED\x10\x00\x12\x18\n\x14INVALID_PHONE_NUMBER\x10\x01\"u\n\x14PhoneFraudAssessment\x12]\n\x16sms_toll_fraud_verdict\x18\x01 \x01(\x0b\x32\x38.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdictB\x03\xe0\x41\x03\"\xbb\x02\n\x19\x41\x63\x63ountDefenderAssessment\x12h\n\x06labels\x18\x01 \x03(\x0e\x32S.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabelB\x03\xe0\x41\x03\"\xb3\x01\n\x14\x41\x63\x63ountDefenderLabel\x12&\n\"ACCOUNT_DEFENDER_LABEL_UNSPECIFIED\x10\x00\x12\x11\n\rPROFILE_MATCH\x10\x01\x12\x1d\n\x19SUSPICIOUS_LOGIN_ACTIVITY\x10\x02\x12\x1f\n\x1bSUSPICIOUS_ACCOUNT_CREATION\x10\x03\x12 \n\x1cRELATED_ACCOUNTS_NUMBER_HIGH\x10\x04\"\x93\x01\n\x10\x43reateKeyRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12:\n\x03key\x18\x02 \x01(\x0b\x32(.google.cloud.recaptchaenterprise.v1.KeyB\x03\xe0\x41\x02\"\x87\x01\n\x0fListKeysRequest\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\"c\n\x10ListKeysResponse\x12\x36\n\x04keys\x18\x01 \x03(\x0b\x32(.google.cloud.recaptchaenterprise.v1.Key\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x1eRetrieveLegacySecretKeyRequest\x12;\n\x03key\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"M\n\rGetKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"\x84\x01\n\x10UpdateKeyRequest\x12:\n\x03key\x18\x01 \x01(\x0b\x32(.google.cloud.recaptchaenterprise.v1.KeyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"P\n\x10\x44\x65leteKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\"\xb5\x01\n\x1b\x43reateFirewallPolicyRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12Q\n\x0f\x66irewall_policy\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x02\"\x93\x01\n\x1bListFirewallPoliciesRequest\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\"\x87\x01\n\x1cListFirewallPoliciesResponse\x12N\n\x11\x66irewall_policies\x18\x01 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"c\n\x18GetFirewallPolicyRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"\xa6\x01\n\x1bUpdateFirewallPolicyRequest\x12Q\n\x0f\x66irewall_policy\x18\x01 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"f\n\x1b\x44\x65leteFirewallPolicyRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"\xaf\x01\n\x1eReorderFirewallPoliciesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12H\n\x05names\x18\x02 \x03(\tB9\xe0\x41\x02\xfa\x41\x33\n1recaptchaenterprise.googleapis.com/FirewallPolicy\"!\n\x1fReorderFirewallPoliciesResponse\"r\n\x11MigrateKeyRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12\x1f\n\x12skip_billing_check\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"U\n\x11GetMetricsRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*recaptchaenterprise.googleapis.com/Metrics\"\xd5\x02\n\x07Metrics\x12\x14\n\x04name\x18\x04 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12H\n\rscore_metrics\x18\x02 \x03(\x0b\x32\x31.google.cloud.recaptchaenterprise.v1.ScoreMetrics\x12P\n\x11\x63hallenge_metrics\x18\x03 \x03(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.ChallengeMetrics:h\xea\x41\x65\n*recaptchaenterprise.googleapis.com/Metrics\x12%projects/{project}/keys/{key}/metrics*\x07metrics2\x07metrics\"<\n\x1fRetrieveLegacySecretKeyResponse\x12\x19\n\x11legacy_secret_key\x18\x01 \x01(\t\"\xb3\x06\n\x03Key\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\x0cweb_settings\x18\x03 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.WebKeySettingsH\x00\x12S\n\x10\x61ndroid_settings\x18\x04 \x01(\x0b\x32\x37.google.cloud.recaptchaenterprise.v1.AndroidKeySettingsH\x00\x12K\n\x0cios_settings\x18\x05 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IOSKeySettingsH\x00\x12S\n\x10\x65xpress_settings\x18\x0b \x01(\x0b\x32\x37.google.cloud.recaptchaenterprise.v1.ExpressKeySettingsH\x00\x12I\n\x06labels\x18\x06 \x03(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1.Key.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x0ftesting_options\x18\t \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.TestingOptionsB\x03\xe0\x41\x01\x12K\n\x0cwaf_settings\x18\n \x01(\x0b\x32\x30.google.cloud.recaptchaenterprise.v1.WafSettingsB\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:U\xea\x41R\n&recaptchaenterprise.googleapis.com/Key\x12\x1dprojects/{project}/keys/{key}*\x04keys2\x03keyB\x13\n\x11platform_settings\"\xf2\x01\n\x0eTestingOptions\x12\x1a\n\rtesting_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01\x12\x64\n\x11testing_challenge\x18\x02 \x01(\x0e\x32\x44.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallengeB\x03\xe0\x41\x01\"^\n\x10TestingChallenge\x12!\n\x1dTESTING_CHALLENGE_UNSPECIFIED\x10\x00\x12\r\n\tNOCAPTCHA\x10\x01\x12\x18\n\x14UNSOLVABLE_CHALLENGE\x10\x02\"\xc5\x08\n\x0eWebKeySettings\x12\x1e\n\x11\x61llow_all_domains\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x61llowed_domains\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x61llow_amp_traffic\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x62\n\x10integration_type\x18\x04 \x01(\x0e\x32\x43.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationTypeB\x03\xe0\x41\x02\x12{\n\x1d\x63hallenge_security_preference\x18\x05 \x01(\x0e\x32O.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreferenceB\x03\xe0\x41\x01\x12\x66\n\x12\x63hallenge_settings\x18\x06 \x01(\x0b\x32\x45.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettingsB\x03\xe0\x41\x01\x1a.\n\x0e\x41\x63tionSettings\x12\x1c\n\x0fscore_threshold\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x1a\xea\x02\n\x11\x43hallengeSettings\x12\x61\n\x10\x64\x65\x66\x61ult_settings\x18\x01 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettingsB\x03\xe0\x41\x02\x12w\n\x0f\x61\x63tion_settings\x18\x02 \x03(\x0b\x32Y.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettings.ActionSettingsEntryB\x03\xe0\x41\x01\x1ay\n\x13\x41\x63tionSettingsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12Q\n\x05value\x18\x02 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettings:\x02\x38\x01\"w\n\x0fIntegrationType\x12 \n\x1cINTEGRATION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SCORE\x10\x01\x12\x0c\n\x08\x43HECKBOX\x10\x02\x12\r\n\tINVISIBLE\x10\x03\x12\x1a\n\x16POLICY_BASED_CHALLENGE\x10\x05\"v\n\x1b\x43hallengeSecurityPreference\x12-\n)CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED\x10\x00\x12\r\n\tUSABILITY\x10\x01\x12\x0b\n\x07\x42\x41LANCE\x10\x02\x12\x0c\n\x08SECURITY\x10\x03\"\x96\x01\n\x12\x41ndroidKeySettings\x12$\n\x17\x61llow_all_package_names\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\"\n\x15\x61llowed_package_names\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x36\n)support_non_google_app_store_distribution\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xac\x01\n\x0eIOSKeySettings\x12!\n\x14\x61llow_all_bundle_ids\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61llowed_bundle_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12V\n\x12\x61pple_developer_id\x18\x03 \x01(\x0b\x32\x35.google.cloud.recaptchaenterprise.v1.AppleDeveloperIdB\x03\xe0\x41\x01\"\x14\n\x12\x45xpressKeySettings\"Z\n\x10\x41ppleDeveloperId\x12\x1b\n\x0bprivate_key\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12\x13\n\x06key_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07team_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa9\x01\n\x11ScoreDistribution\x12_\n\rscore_buckets\x18\x01 \x03(\x0b\x32H.google.cloud.recaptchaenterprise.v1.ScoreDistribution.ScoreBucketsEntry\x1a\x33\n\x11ScoreBucketsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\xab\x02\n\x0cScoreMetrics\x12O\n\x0foverall_metrics\x18\x01 \x01(\x0b\x32\x36.google.cloud.recaptchaenterprise.v1.ScoreDistribution\x12\\\n\x0e\x61\x63tion_metrics\x18\x02 \x03(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.ScoreMetrics.ActionMetricsEntry\x1al\n\x12\x41\x63tionMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.recaptchaenterprise.v1.ScoreDistribution:\x02\x38\x01\"o\n\x10\x43hallengeMetrics\x12\x16\n\x0epageload_count\x18\x01 \x01(\x03\x12\x17\n\x0fnocaptcha_count\x18\x02 \x01(\x03\x12\x14\n\x0c\x66\x61iled_count\x18\x03 \x01(\x03\x12\x14\n\x0cpassed_count\x18\x04 \x01(\x03\"\x95\x01\n\x18\x46irewallPolicyAssessment\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12Q\n\x0f\x66irewall_policy\x18\x08 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicyB\x03\xe0\x41\x03\"\x82\x06\n\x0e\x46irewallAction\x12P\n\x05\x61llow\x18\x01 \x01(\x0b\x32?.google.cloud.recaptchaenterprise.v1.FirewallAction.AllowActionH\x00\x12P\n\x05\x62lock\x18\x02 \x01(\x0b\x32?.google.cloud.recaptchaenterprise.v1.FirewallAction.BlockActionH\x00\x12t\n\x18include_recaptcha_script\x18\x06 \x01(\x0b\x32P.google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptActionH\x00\x12V\n\x08redirect\x18\x05 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectActionH\x00\x12Z\n\nsubstitute\x18\x03 \x01(\x0b\x32\x44.google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteActionH\x00\x12Y\n\nset_header\x18\x04 \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderActionH\x00\x1a\r\n\x0b\x41llowAction\x1a\r\n\x0b\x42lockAction\x1a\x1e\n\x1cIncludeRecaptchaScriptAction\x1a\x10\n\x0eRedirectAction\x1a%\n\x10SubstituteAction\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x37\n\x0fSetHeaderAction\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\x17\n\x15\x66irewall_action_oneof\"\xc5\x02\n\x0e\x46irewallPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04path\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tcondition\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12I\n\x07\x61\x63tions\x18\x06 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.FirewallActionB\x03\xe0\x41\x01:\x8f\x01\xea\x41\x8b\x01\n1recaptchaenterprise.googleapis.com/FirewallPolicy\x12\x34projects/{project}/firewallpolicies/{firewallpolicy}*\x10\x66irewallPolicies2\x0e\x66irewallPolicy\"\xb6\x01\n)ListRelatedAccountGroupMembershipsRequest\x12X\n\x06parent\x18\x01 \x01(\tBH\xe0\x41\x02\xfa\x41\x42\x12@recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership\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\"\xb4\x01\n*ListRelatedAccountGroupMembershipsResponse\x12m\n!related_account_group_memberships\x18\x01 \x03(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa2\x01\n\x1fListRelatedAccountGroupsRequest\x12N\n\x06parent\x18\x01 \x01(\tB>\xe0\x41\x02\xfa\x41\x38\x12\x36recaptchaenterprise.googleapis.com/RelatedAccountGroup\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\"\x95\x01\n ListRelatedAccountGroupsResponse\x12X\n\x16related_account_groups\x18\x01 \x03(\x0b\x32\x38.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xdf\x01\n+SearchRelatedAccountGroupMembershipsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x17\n\naccount_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x11hashed_account_id\x18\x02 \x01(\x0c\x42\x05\x18\x01\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb6\x01\n,SearchRelatedAccountGroupMembershipsResponse\x12m\n!related_account_group_memberships\x18\x01 \x03(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x14\x41\x64\x64IpOverrideRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12R\n\x10ip_override_data\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideDataB\x03\xe0\x41\x02\"\x17\n\x15\x41\x64\x64IpOverrideResponse\"\xab\x01\n\x17RemoveIpOverrideRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\x12R\n\x10ip_override_data\x18\x02 \x01(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideDataB\x03\xe0\x41\x02\"\x1a\n\x18RemoveIpOverrideResponse\"\x89\x01\n\x16ListIpOverridesRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recaptchaenterprise.googleapis.com/Key\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\x17ListIpOverridesResponse\x12I\n\x0cip_overrides\x18\x01 \x03(\x0b\x32\x33.google.cloud.recaptchaenterprise.v1.IpOverrideData\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc8\x02\n\x1dRelatedAccountGroupMembership\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x02\x12\x12\n\naccount_id\x18\x04 \x01(\t\x12\x1d\n\x11hashed_account_id\x18\x02 \x01(\x0c\x42\x02\x18\x01:\xdd\x01\xea\x41\xd9\x01\n@recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership\x12Vprojects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}*\x1erelatedAccountGroupMemberships2\x1drelatedAccountGroupMembership\"\xd4\x01\n\x13RelatedAccountGroup\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x02:\xa6\x01\xea\x41\xa2\x01\n6recaptchaenterprise.googleapis.com/RelatedAccountGroup\x12=projects/{project}/relatedaccountgroups/{relatedaccountgroup}*\x14relatedAccountGroups2\x13relatedAccountGroup\"\x8b\x03\n\x0bWafSettings\x12U\n\x0bwaf_service\x18\x01 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.WafSettings.WafServiceB\x03\xe0\x41\x02\x12U\n\x0bwaf_feature\x18\x02 \x01(\x0e\x32;.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeatureB\x03\xe0\x41\x02\"s\n\nWafFeature\x12\x1b\n\x17WAF_FEATURE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43HALLENGE_PAGE\x10\x01\x12\x11\n\rSESSION_TOKEN\x10\x02\x12\x10\n\x0c\x41\x43TION_TOKEN\x10\x03\x12\x0f\n\x07\x45XPRESS\x10\x05\x1a\x02\x08\x01\"Y\n\nWafService\x12\x1b\n\x17WAF_SERVICE_UNSPECIFIED\x10\x00\x12\x06\n\x02\x43\x41\x10\x01\x12\n\n\x06\x46\x41STLY\x10\x03\x12\x0e\n\nCLOUDFLARE\x10\x04\x12\n\n\x06\x41KAMAI\x10\x05\"B\n\x15\x41ssessmentEnvironment\x12\x13\n\x06\x63lient\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xc1\x01\n\x0eIpOverrideData\x12\x17\n\x02ip\x18\x01 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x04\x12\\\n\roverride_type\x18\x03 \x01(\x0e\x32@.google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideTypeB\x03\xe0\x41\x02\"8\n\x0cOverrideType\x12\x1d\n\x19OVERRIDE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x32\xe5$\n\x1aRecaptchaEnterpriseService\x12\xce\x01\n\x10\x43reateAssessment\x12<.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest\x1a/.google.cloud.recaptchaenterprise.v1.Assessment\"K\xda\x41\x11parent,assessment\x82\xd3\xe4\x93\x02\x31\"#/v1/{parent=projects/*}/assessments:\nassessment\x12\xe0\x01\n\x12\x41nnotateAssessment\x12>.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest\x1a?.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse\"I\xda\x41\x0fname,annotation\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/assessments/*}:annotate:\x01*\x12\xa4\x01\n\tCreateKey\x12\x35.google.cloud.recaptchaenterprise.v1.CreateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"6\xda\x41\nparent,key\x82\xd3\xe4\x93\x02#\"\x1c/v1/{parent=projects/*}/keys:\x03key\x12\xa6\x01\n\x08ListKeys\x12\x34.google.cloud.recaptchaenterprise.v1.ListKeysRequest\x1a\x35.google.cloud.recaptchaenterprise.v1.ListKeysResponse\"-\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=projects/*}/keys\x12\xe7\x01\n\x17RetrieveLegacySecretKey\x12\x43.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest\x1a\x44.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse\"A\xda\x41\x03key\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey\x12\x93\x01\n\x06GetKey\x12\x32.google.cloud.recaptchaenterprise.v1.GetKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"+\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{name=projects/*/keys/*}\x12\xad\x01\n\tUpdateKey\x12\x35.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"?\xda\x41\x0fkey,update_mask\x82\xd3\xe4\x93\x02\'2 /v1/{key.name=projects/*/keys/*}:\x03key\x12\x87\x01\n\tDeleteKey\x12\x35.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest\x1a\x16.google.protobuf.Empty\"+\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1e*\x1c/v1/{name=projects/*/keys/*}\x12\x9f\x01\n\nMigrateKey\x12\x36.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest\x1a(.google.cloud.recaptchaenterprise.v1.Key\"/\x82\xd3\xe4\x93\x02)\"$/v1/{name=projects/*/keys/*}:migrate:\x01*\x12\xd5\x01\n\rAddIpOverride\x12\x39.google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest\x1a:.google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse\"M\xda\x41\x15name,ip_override_data\x82\xd3\xe4\x93\x02/\"*/v1/{name=projects/*/keys/*}:addIpOverride:\x01*\x12\xe1\x01\n\x10RemoveIpOverride\x12<.google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest\x1a=.google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse\"P\xda\x41\x15name,ip_override_data\x82\xd3\xe4\x93\x02\x32\"-/v1/{name=projects/*/keys/*}:removeIpOverride:\x01*\x12\xcd\x01\n\x0fListIpOverrides\x12;.google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest\x1a<.google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/keys/*}:listIpOverrides\x12\xa7\x01\n\nGetMetrics\x12\x36.google.cloud.recaptchaenterprise.v1.GetMetricsRequest\x1a,.google.cloud.recaptchaenterprise.v1.Metrics\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v1/{name=projects/*/keys/*/metrics}\x12\xe9\x01\n\x14\x43reateFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"Z\xda\x41\x16parent,firewall_policy\x82\xd3\xe4\x93\x02;\"(/v1/{parent=projects/*}/firewallpolicies:\x0f\x66irewall_policy\x12\xd6\x01\n\x14ListFirewallPolicies\x12@.google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest\x1a\x41.google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*}/firewallpolicies\x12\xc0\x01\n\x11GetFirewallPolicy\x12=.google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/firewallpolicies/*}\x12\xfe\x01\n\x14UpdateFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest\x1a\x33.google.cloud.recaptchaenterprise.v1.FirewallPolicy\"o\xda\x41\x1b\x66irewall_policy,update_mask\x82\xd3\xe4\x93\x02K28/v1/{firewall_policy.name=projects/*/firewallpolicies/*}:\x0f\x66irewall_policy\x12\xa9\x01\n\x14\x44\x65leteFirewallPolicy\x12@.google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/firewallpolicies/*}\x12\xf0\x01\n\x17ReorderFirewallPolicies\x12\x43.google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest\x1a\x44.google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse\"J\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x35\"0/v1/{parent=projects/*}/firewallpolicies:reorder:\x01*\x12\xe6\x01\n\x18ListRelatedAccountGroups\x12\x44.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest\x1a\x45.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*}/relatedaccountgroups\x12\x92\x02\n\"ListRelatedAccountGroupMemberships\x12N.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest\x1aO.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/relatedaccountgroups/*}/memberships\x12\xb2\x02\n$SearchRelatedAccountGroupMemberships\x12P.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest\x1aQ.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse\"e\xda\x41\x19project,hashed_account_id\x82\xd3\xe4\x93\x02\x43\">/v1/{project=projects/*}/relatedaccountgroupmemberships:search:\x01*\x1aV\xca\x41\"recaptchaenterprise.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x99\x02\n!com.google.recaptchaenterprise.v1B\x18RecaptchaEnterpriseProtoP\x01Z\\cloud.google.com/go/recaptchaenterprise/v2/apiv1/recaptchaenterprisepb;recaptchaenterprisepb\xa2\x02\x04GCRE\xaa\x02#Google.Cloud.RecaptchaEnterprise.V1\xca\x02#Google\\Cloud\\RecaptchaEnterprise\\V1\xea\x02&Google::Cloud::RecaptchaEnterprise::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.FieldMask", "google/protobuf/field_mask.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 RecaptchaEnterprise - module V1 - CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest").msgclass - TransactionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionEvent").msgclass - TransactionEvent::TransactionEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionEvent.TransactionEventType").enummodule - PhoneAuthenticationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PhoneAuthenticationEvent").msgclass - AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest").msgclass - AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation").enummodule - AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason").enummodule - AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse").msgclass - EndpointVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.EndpointVerificationInfo").msgclass - AccountVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountVerificationInfo").msgclass - AccountVerificationInfo::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result").enummodule - PrivatePasswordLeakVerification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification").msgclass - Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Assessment").msgclass - Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event").msgclass - Event::FraudPrevention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event.FraudPrevention").enummodule - TransactionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData").msgclass - TransactionData::Address = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.Address").msgclass - TransactionData::User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.User").msgclass - TransactionData::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.Item").msgclass - TransactionData::GatewayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TransactionData.GatewayInfo").msgclass - UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UserInfo").msgclass - UserId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UserId").msgclass - RiskAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis").msgclass - RiskAnalysis::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason").enummodule - RiskAnalysis::Challenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RiskAnalysis.Challenge").enummodule - Bot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Bot").msgclass - Bot::BotType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Bot.BotType").enummodule - TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties").msgclass - TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason").enummodule - FraudPreventionAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment").msgclass - FraudPreventionAssessment::RiskReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason").msgclass - FraudPreventionAssessment::RiskReason::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.RiskReason.Reason").enummodule - FraudPreventionAssessment::StolenInstrumentVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.StolenInstrumentVerdict").msgclass - FraudPreventionAssessment::CardTestingVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.CardTestingVerdict").msgclass - FraudPreventionAssessment::BehavioralTrustVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.BehavioralTrustVerdict").msgclass - FraudSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals").msgclass - FraudSignals::UserSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.UserSignals").msgclass - FraudSignals::CardSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals").msgclass - FraudSignals::CardSignals::CardLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FraudSignals.CardSignals.CardLabel").enummodule - SmsTollFraudVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict").msgclass - SmsTollFraudVerdict::SmsTollFraudReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason").enummodule - PhoneFraudAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment").msgclass - AccountDefenderAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment").msgclass - AccountDefenderAssessment::AccountDefenderLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel").enummodule - CreateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateKeyRequest").msgclass - ListKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysRequest").msgclass - ListKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListKeysResponse").msgclass - RetrieveLegacySecretKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest").msgclass - GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetKeyRequest").msgclass - UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateKeyRequest").msgclass - DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteKeyRequest").msgclass - CreateFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest").msgclass - ListFirewallPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesRequest").msgclass - ListFirewallPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListFirewallPoliciesResponse").msgclass - GetFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetFirewallPolicyRequest").msgclass - UpdateFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateFirewallPolicyRequest").msgclass - DeleteFirewallPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteFirewallPolicyRequest").msgclass - ReorderFirewallPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesRequest").msgclass - ReorderFirewallPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ReorderFirewallPoliciesResponse").msgclass - MigrateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.MigrateKeyRequest").msgclass - GetMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetMetricsRequest").msgclass - Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Metrics").msgclass - RetrieveLegacySecretKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse").msgclass - Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Key").msgclass - TestingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions").msgclass - TestingOptions::TestingChallenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge").enummodule - WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings").msgclass - WebKeySettings::ActionSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ActionSettings").msgclass - WebKeySettings::ChallengeSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSettings").msgclass - WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType").enummodule - WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference").enummodule - AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AndroidKeySettings").msgclass - IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IOSKeySettings").msgclass - ExpressKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ExpressKeySettings").msgclass - AppleDeveloperId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AppleDeveloperId").msgclass - ScoreDistribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreDistribution").msgclass - ScoreMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreMetrics").msgclass - ChallengeMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ChallengeMetrics").msgclass - FirewallPolicyAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment").msgclass - FirewallAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction").msgclass - FirewallAction::AllowAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.AllowAction").msgclass - FirewallAction::BlockAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.BlockAction").msgclass - FirewallAction::IncludeRecaptchaScriptAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.IncludeRecaptchaScriptAction").msgclass - FirewallAction::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.RedirectAction").msgclass - FirewallAction::SubstituteAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.SubstituteAction").msgclass - FirewallAction::SetHeaderAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallAction.SetHeaderAction").msgclass - FirewallPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.FirewallPolicy").msgclass - ListRelatedAccountGroupMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest").msgclass - ListRelatedAccountGroupMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse").msgclass - ListRelatedAccountGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest").msgclass - ListRelatedAccountGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse").msgclass - SearchRelatedAccountGroupMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest").msgclass - SearchRelatedAccountGroupMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse").msgclass - AddIpOverrideRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AddIpOverrideRequest").msgclass - AddIpOverrideResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AddIpOverrideResponse").msgclass - RemoveIpOverrideRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RemoveIpOverrideRequest").msgclass - RemoveIpOverrideResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RemoveIpOverrideResponse").msgclass - ListIpOverridesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListIpOverridesRequest").msgclass - ListIpOverridesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ListIpOverridesResponse").msgclass - RelatedAccountGroupMembership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership").msgclass - RelatedAccountGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.RelatedAccountGroup").msgclass - WafSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings").msgclass - WafSettings::WafFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature").enummodule - WafSettings::WafService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WafSettings.WafService").enummodule - AssessmentEnvironment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AssessmentEnvironment").msgclass - IpOverrideData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IpOverrideData").msgclass - IpOverrideData::OverrideType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb deleted file mode 100644 index 86e7915c82df..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb +++ /dev/null @@ -1,105 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.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/recaptchaenterprise/v1/recaptchaenterprise_pb' - -module Google - module Cloud - module RecaptchaEnterprise - module V1 - module RecaptchaEnterpriseService - # Service to determine the likelihood an event is legitimate. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' - - # Creates an Assessment of the likelihood an event is legitimate. - rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Assessment - # Annotates a previously created Assessment to provide additional information - # on whether the event turned out to be authentic or fraudulent. - rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse - # Creates a new reCAPTCHA Enterprise key. - rpc :CreateKey, ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key - # Returns the list of all keys that belong to a project. - rpc :ListKeys, ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse - # Returns the secret key related to the specified public key. - # You must use the legacy secret key only in a 3rd party integration with - # legacy reCAPTCHA. - rpc :RetrieveLegacySecretKey, ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse - # Returns the specified key. - rpc :GetKey, ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key - # Updates the specified key. - rpc :UpdateKey, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key - # Deletes the specified key. - rpc :DeleteKey, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Google::Protobuf::Empty - # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. - # Once a key is migrated, it can be used from either product. SiteVerify - # requests are billed as CreateAssessment calls. You must be - # authenticated as one of the current owners of the reCAPTCHA Key, and - # your user must have the reCAPTCHA Enterprise Admin IAM role in the - # destination project. - rpc :MigrateKey, ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key - # Adds an IP override to a key. The following restrictions hold: - # * The maximum number of IP overrides per key is 1000. - # * For any conflict (such as IP already exists or IP part of an existing - # IP range), an error is returned. - rpc :AddIpOverride, ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse - # Removes an IP override from a key. The following restrictions hold: - # * If the IP isn't found in an existing IP override, a `NOT_FOUND` error - # is returned. - # * If the IP is found in an existing IP override, but the - # override type does not match, a `NOT_FOUND` error is returned. - rpc :RemoveIpOverride, ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse - # Lists all IP overrides for a key. - rpc :ListIpOverrides, ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse - # Get some aggregated metrics for a Key. This data can be used to build - # dashboards. - rpc :GetMetrics, ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Metrics - # Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA - # Enterprise actions can be executed. - # A project may have a maximum of 1000 policies. - rpc :CreateFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy - # Returns the list of all firewall policies that belong to a project. - rpc :ListFirewallPolicies, ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse - # Returns the specified firewall policy. - rpc :GetFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy - # Updates the specified firewall policy. - rpc :UpdateFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy - # Deletes the specified firewall policy. - rpc :DeleteFirewallPolicy, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::Google::Protobuf::Empty - # Reorders all firewall policies. - rpc :ReorderFirewallPolicies, ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse - # List groups of related accounts. - rpc :ListRelatedAccountGroups, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse - # Get memberships in a group of related accounts. - rpc :ListRelatedAccountGroupMemberships, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse - # Search group memberships related to a given account. - rpc :SearchRelatedAccountGroupMemberships, ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md deleted file mode 100644 index 5801e8b5fa14..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# reCAPTCHA Enterprise 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-recaptcha_enterprise-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb deleted file mode 100644 index 56c8b1952bff..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb +++ /dev/null @@ -1,2230 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecaptchaEnterprise - module V1 - # The create assessment request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which the assessment is created, - # in the format `projects/{project}`. - # @!attribute [rw] assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Assessment] - # Required. The assessment details. - class CreateAssessmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes an event in the lifecycle of a payment transaction. - # @!attribute [rw] event_type - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent::TransactionEventType] - # Optional. The type of this transaction event. - # @!attribute [rw] reason - # @return [::String] - # Optional. The reason or standardized code that corresponds with this - # transaction event, if one exists. For example, a CHARGEBACK event with code - # 6005. - # @!attribute [rw] value - # @return [::Float] - # Optional. The value that corresponds with this transaction event, if one - # exists. For example, a refund event where $5.00 was refunded. Currency is - # obtained from the original transaction data. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when this transaction event occurred; otherwise assumed - # to be the time of the API call. - class TransactionEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents an event in the payment transaction lifecycle. - # Ensure that applications can handle values not explicitly listed. - module TransactionEventType - # Default, unspecified event type. - TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0 - - # Indicates that the transaction is approved by the merchant. The - # accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', - # 'CYBERSOURCE', or 'MANUAL_REVIEW'. - MERCHANT_APPROVE = 1 - - # Indicates that the transaction is denied and concluded due to risks - # detected by the merchant. The accompanying reasons can include terms such - # as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. - MERCHANT_DENY = 2 - - # Indicates that the transaction is being evaluated by a human, due to - # suspicion or risk. - MANUAL_REVIEW = 3 - - # Indicates that the authorization attempt with the card issuer succeeded. - AUTHORIZATION = 4 - - # Indicates that the authorization attempt with the card issuer failed. - # The accompanying reasons can include Visa's '54' indicating that the card - # is expired, or '82' indicating that the CVV is incorrect. - AUTHORIZATION_DECLINE = 5 - - # Indicates that the transaction is completed because the funds were - # settled. - PAYMENT_CAPTURE = 6 - - # Indicates that the transaction could not be completed because the funds - # were not settled. - PAYMENT_CAPTURE_DECLINE = 7 - - # Indicates that the transaction has been canceled. Specify the reason - # for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. - CANCEL = 8 - - # Indicates that the merchant has received a chargeback inquiry due to - # fraud for the transaction, requesting additional information before a - # fraud chargeback is officially issued and a formal chargeback - # notification is sent. - CHARGEBACK_INQUIRY = 9 - - # Indicates that the merchant has received a chargeback alert due to fraud - # for the transaction. The process of resolving the dispute without - # involving the payment network is started. - CHARGEBACK_ALERT = 10 - - # Indicates that a fraud notification is issued for the transaction, sent - # by the payment instrument's issuing bank because the transaction appears - # to be fraudulent. We recommend including TC40 or SAFE data in the - # `reason` field for this event type. For partial chargebacks, we recommend - # that you include an amount in the `value` field. - FRAUD_NOTIFICATION = 11 - - # Indicates that the merchant is informed by the payment network that the - # transaction has entered the chargeback process due to fraud. Reason code - # examples include Discover's '6005' and '6041'. For partial chargebacks, - # we recommend that you include an amount in the `value` field. - CHARGEBACK = 12 - - # Indicates that the transaction has entered the chargeback process due to - # fraud, and that the merchant has chosen to enter representment. Reason - # examples include Discover's '6005' and '6041'. For partial chargebacks, - # we recommend that you include an amount in the `value` field. - CHARGEBACK_REPRESENTMENT = 13 - - # Indicates that the transaction has had a fraud chargeback which was - # illegitimate and was reversed as a result. For partial chargebacks, we - # recommend that you include an amount in the `value` field. - CHARGEBACK_REVERSE = 14 - - # Indicates that the merchant has received a refund for a completed - # transaction. For partial refunds, we recommend that you include an amount - # in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of - # exempt tax) - REFUND_REQUEST = 15 - - # Indicates that the merchant has received a refund request for this - # transaction, but that they have declined it. For partial refunds, we - # recommend that you include an amount in the `value` field. Reason - # example: 'TAX_EXEMPT' (partial refund of exempt tax) - REFUND_DECLINE = 16 - - # Indicates that the completed transaction was refunded by the merchant. - # For partial refunds, we recommend that you include an amount in the - # `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt - # tax) - REFUND = 17 - - # Indicates that the completed transaction was refunded by the merchant, - # and that this refund was reversed. For partial refunds, we recommend that - # you include an amount in the `value` field. - REFUND_REVERSE = 18 - end - end - - # Details on a phone authentication event - # @!attribute [rw] phone_number - # @return [::String] - # Required. Phone number in E.164 format for which a multi-factor - # authentication challenge was initiated, succeeded, or failed. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time at which the multi-factor authentication event - # (challenge or verification) occurred. - class PhoneAuthenticationEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to annotate an Assessment. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Assessment, in the format - # `projects/{project}/assessments/{assessment}`. - # @!attribute [rw] annotation - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation] - # Optional. The annotation that is assigned to the Event. This field can be - # left empty to provide reasons that apply to an event without concluding - # whether the event is legitimate or fraudulent. - # @!attribute [rw] reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>] - # Optional. Reasons for the annotation that are assigned to the event. - # @!attribute [rw] account_id - # @return [::String] - # Optional. A stable account identifier to apply to the assessment. This is - # an alternative to setting `account_id` in `CreateAssessment`, for example - # when a stable account identifier is not yet known in the initial request. - # @!attribute [rw] hashed_account_id - # @return [::String] - # Optional. A stable hashed account identifier to apply to the assessment. - # This is an alternative to setting `hashed_account_id` in - # `CreateAssessment`, for example when a stable account identifier is not yet - # known in the initial request. - # @!attribute [rw] transaction_event - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent] - # Optional. If the assessment is part of a payment transaction, provide - # details on payment lifecycle events that occur in the transaction. - # @!attribute [rw] phone_authentication_event - # @return [::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent] - # Optional. If using an external multi-factor authentication provider, - # provide phone authentication details for fraud detection purposes. - class AnnotateAssessmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the types of annotations. - module Annotation - # Default unspecified type. - ANNOTATION_UNSPECIFIED = 0 - - # Provides information that the event turned out to be legitimate. - LEGITIMATE = 1 - - # Provides information that the event turned out to be fraudulent. - FRAUDULENT = 2 - - # Provides information that the event was related to a login event in which - # the user typed the correct password. Deprecated, prefer indicating - # CORRECT_PASSWORD through the reasons field instead. - PASSWORD_CORRECT = 3 - - # Provides information that the event was related to a login event in which - # the user typed the incorrect password. Deprecated, prefer indicating - # INCORRECT_PASSWORD through the reasons field instead. - PASSWORD_INCORRECT = 4 - end - - # Enum that represents potential reasons for annotating an assessment. - module Reason - # Unspecified reason. Do not use. - REASON_UNSPECIFIED = 0 - - # Indicates that the transaction had a chargeback issued with no other - # details. When possible, specify the type by using CHARGEBACK_FRAUD or - # CHARGEBACK_DISPUTE instead. - CHARGEBACK = 1 - - # Indicates that the transaction had a chargeback issued related to an - # alleged unauthorized transaction from the cardholder's perspective (for - # example, the card number was stolen). - CHARGEBACK_FRAUD = 8 - - # Indicates that the transaction had a chargeback issued related to the - # cardholder having provided their card details but allegedly not being - # satisfied with the purchase (for example, misrepresentation, attempted - # cancellation). - CHARGEBACK_DISPUTE = 9 - - # Indicates that the completed payment transaction was refunded by the - # seller. - REFUND = 10 - - # Indicates that the completed payment transaction was determined to be - # fraudulent by the seller, and was cancelled and refunded as a result. - REFUND_FRAUD = 11 - - # Indicates that the payment transaction was accepted, and the user was - # charged. - TRANSACTION_ACCEPTED = 12 - - # Indicates that the payment transaction was declined, for example due to - # invalid card details. - TRANSACTION_DECLINED = 13 - - # Indicates the transaction associated with the assessment is suspected of - # being fraudulent based on the payment method, billing details, shipping - # address or other transaction information. - PAYMENT_HEURISTICS = 2 - - # Indicates that the user was served a 2FA challenge. An old assessment - # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been - # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. - # This is equivalent to `FAILED_TWO_FACTOR`. - INITIATED_TWO_FACTOR = 7 - - # Indicates that the user passed a 2FA challenge. - PASSED_TWO_FACTOR = 3 - - # Indicates that the user failed a 2FA challenge. - FAILED_TWO_FACTOR = 4 - - # Indicates the user provided the correct password. - CORRECT_PASSWORD = 5 - - # Indicates the user provided an incorrect password. - INCORRECT_PASSWORD = 6 - - # Indicates that the user sent unwanted and abusive messages to other users - # of the platform, such as spam, scams, phishing, or social engineering. - SOCIAL_SPAM = 14 - end - end - - # Empty response for AnnotateAssessment. - class AnnotateAssessmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about a verification endpoint that can be used for 2FA. - # @!attribute [rw] email_address - # @return [::String] - # Email address for which to trigger a verification request. - # - # Note: The following fields are mutually exclusive: `email_address`, `phone_number`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] phone_number - # @return [::String] - # Phone number for which to trigger a verification request. Should be given - # in E.164 format. - # - # Note: The following fields are mutually exclusive: `phone_number`, `email_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] request_token - # @return [::String] - # Output only. Token to provide to the client to trigger endpoint - # verification. It must be used within 15 minutes. - # @!attribute [r] last_verification_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp of the last successful verification for the - # endpoint, if any. - class EndpointVerificationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about account verification, used for identity verification. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::EndpointVerificationInfo>] - # Optional. Endpoints that can be used for identity verification. - # @!attribute [rw] language_code - # @return [::String] - # Optional. Language code preference for the verification message, set as a - # IETF BCP 47 language code. - # @!attribute [r] latest_verification_result - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountVerificationInfo::Result] - # Output only. Result of the latest account verification challenge. - # @!attribute [rw] username - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Username of the account that is being verified. Deprecated. Customers - # should now provide the `account_id` field in `event.user_info`. - class AccountVerificationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Result of the account verification as contained in the verdict token issued - # at the end of the verification flow. - # Ensure that applications can handle values not explicitly listed. - module Result - # No information about the latest account verification. - RESULT_UNSPECIFIED = 0 - - # The user was successfully verified. This means the account verification - # challenge was successfully completed. - SUCCESS_USER_VERIFIED = 1 - - # The user failed the verification challenge. - ERROR_USER_NOT_VERIFIED = 2 - - # The site is not properly onboarded to use the account verification - # feature. - ERROR_SITE_ONBOARDING_INCOMPLETE = 3 - - # The recipient is not allowed for account verification. This can occur - # during integration but should not occur in production. - ERROR_RECIPIENT_NOT_ALLOWED = 4 - - # The recipient has already been sent too many verification codes in a - # short amount of time. - ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5 - - # The verification flow could not be completed due to a critical internal - # error. - ERROR_CRITICAL_INTERNAL = 6 - - # The client has exceeded their two factor request quota for this period of - # time. - ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7 - - # The request cannot be processed at the time because of an incident. This - # bypass can be restricted to a problematic destination email domain, a - # customer, or could affect the entire service. - ERROR_VERIFICATION_BYPASSED = 8 - - # The request parameters do not match with the token provided and cannot be - # processed. - ERROR_VERDICT_MISMATCH = 9 - end - end - - # Private password leak verification info. - # @!attribute [rw] lookup_hash_prefix - # @return [::String] - # Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized - # username. It is used to look up password leaks associated with that hash - # prefix. - # @!attribute [rw] encrypted_user_credentials_hash - # @return [::String] - # Optional. Encrypted Scrypt hash of the canonicalized username+password. It - # is re-encrypted by the server and returned through - # `reencrypted_user_credentials_hash`. - # @!attribute [r] encrypted_leak_match_prefixes - # @return [::Array<::String>] - # Output only. List of prefixes of the encrypted potential password leaks - # that matched the given parameters. They must be compared with the - # client-side decryption prefix of `reencrypted_user_credentials_hash` - # @!attribute [r] reencrypted_user_credentials_hash - # @return [::String] - # Output only. Corresponds to the re-encryption of the - # `encrypted_user_credentials_hash` field. It is used to match potential - # password leaks within `encrypted_leak_match_prefixes`. - class PrivatePasswordLeakVerification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reCAPTCHA Enterprise assessment resource. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name for the Assessment in the format - # `projects/{project}/assessments/{assessment}`. - # @!attribute [rw] event - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Event] - # Optional. The event being assessed. - # @!attribute [r] risk_analysis - # @return [::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis] - # Output only. The risk analysis result for the event being assessed. - # @!attribute [r] token_properties - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TokenProperties] - # Output only. Properties of the provided event token. - # @!attribute [rw] account_verification - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountVerificationInfo] - # Optional. Account verification information for identity verification. The - # assessment event must include a token and site key to use this feature. - # @!attribute [r] account_defender_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AccountDefenderAssessment] - # Output only. Assessment returned by account defender when an account - # identifier is provided. - # @!attribute [rw] private_password_leak_verification - # @return [::Google::Cloud::RecaptchaEnterprise::V1::PrivatePasswordLeakVerification] - # Optional. The private password leak verification field contains the - # parameters that are used to to check for leaks privately without sharing - # user credentials. - # @!attribute [r] firewall_policy_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicyAssessment] - # Output only. Assessment returned when firewall policies belonging to the - # project are evaluated using the field firewall_policy_evaluation. - # @!attribute [r] fraud_prevention_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment] - # Output only. Assessment returned by Fraud Prevention when TransactionData - # is provided. - # @!attribute [r] fraud_signals - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals] - # Output only. Fraud Signals specific to the users involved in a payment - # transaction. - # @!attribute [r] phone_fraud_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::PhoneFraudAssessment] - # Output only. Assessment returned when a site key, a token, and a phone - # number as `user_id` are provided. Account defender and SMS toll fraud - # protection need to be enabled. - # @!attribute [rw] assessment_environment - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AssessmentEnvironment] - # Optional. The environment creating the assessment. This describes your - # environment (the system invoking CreateAssessment), NOT the environment of - # your user. - class Assessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The event being assessed. - # @!attribute [rw] token - # @return [::String] - # Optional. The user response token provided by the reCAPTCHA Enterprise - # client-side integration on your site. - # @!attribute [rw] site_key - # @return [::String] - # Optional. The site key that was used to invoke reCAPTCHA Enterprise on your - # site and generate the token. - # @!attribute [rw] user_agent - # @return [::String] - # Optional. The user agent present in the request from the user's device - # related to this event. - # @!attribute [rw] user_ip_address - # @return [::String] - # Optional. The IP address in the request from the user's device related to - # this event. - # @!attribute [rw] expected_action - # @return [::String] - # Optional. The expected action for this type of event. This should be the - # same action provided at token generation time on client-side platforms - # already integrated with recaptcha enterprise. - # @!attribute [rw] hashed_account_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. Deprecated: use `user_info.account_id` instead. - # Unique stable hashed user identifier for the request. The identifier must - # be hashed using hmac-sha256 with stable secret. - # @!attribute [rw] express - # @return [::Boolean] - # Optional. Flag for a reCAPTCHA express request for an assessment without a - # token. If enabled, `site_key` must reference an Express site key. - # @!attribute [rw] requested_uri - # @return [::String] - # Optional. The URI resource the user requested that triggered an assessment. - # @!attribute [rw] waf_token_assessment - # @return [::Boolean] - # Optional. Flag for running Web Application Firewall (WAF) token assessment. - # If enabled, the token must be specified, and have been created by a - # WAF-enabled key. - # @!attribute [rw] ja3 - # @return [::String] - # Optional. JA3 fingerprint for SSL clients. To learn how to compute this - # fingerprint, please refer to https://github.com/salesforce/ja3. - # @!attribute [rw] ja4 - # @return [::String] - # Optional. JA4 fingerprint for SSL clients. To learn how to compute this - # fingerprint, please refer to https://github.com/FoxIO-LLC/ja4. - # @!attribute [rw] headers - # @return [::Array<::String>] - # Optional. HTTP header information about the request. - # @!attribute [rw] firewall_policy_evaluation - # @return [::Boolean] - # Optional. Flag for enabling firewall policy config assessment. - # If this flag is enabled, the firewall policy is evaluated and a - # suggested firewall action is returned in the response. - # @!attribute [rw] transaction_data - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData] - # Optional. Data describing a payment transaction to be assessed. Sending - # this data enables reCAPTCHA Enterprise Fraud Prevention and the - # FraudPreventionAssessment component in the response. - # @!attribute [rw] user_info - # @return [::Google::Cloud::RecaptchaEnterprise::V1::UserInfo] - # Optional. Information about the user that generates this event, when they - # can be identified. They are often identified through the use of an account - # for logged-in requests or login/registration requests, or by providing user - # identifiers for guest actions like checkout. - # @!attribute [rw] fraud_prevention - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Event::FraudPrevention] - # Optional. The Fraud Prevention setting for this assessment. - class Event - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Setting that controls Fraud Prevention assessments. - # Ensure that applications can handle values not explicitly listed. - module FraudPrevention - # Default, unspecified setting. `fraud_prevention_assessment` is returned - # if `transaction_data` is present in `Event` and Fraud Prevention is - # enabled in the Google Cloud console. - FRAUD_PREVENTION_UNSPECIFIED = 0 - - # Enable Fraud Prevention for this assessment, if Fraud Prevention is - # enabled in the Google Cloud console. - ENABLED = 1 - - # Disable Fraud Prevention for this assessment, regardless of the Google - # Cloud console settings. - DISABLED = 2 - end - end - - # Transaction data associated with a payment protected by reCAPTCHA Enterprise. - # @!attribute [rw] transaction_id - # @return [::String] - # Unique identifier for the transaction. This custom identifier can be used - # to reference this transaction in the future, for example, labeling a refund - # or chargeback event. Two attempts at the same transaction should use the - # same transaction id. - # @!attribute [rw] payment_method - # @return [::String] - # Optional. The payment method for the transaction. The allowed values are: - # - # * credit-card - # * debit-card - # * gift-card - # * processor-\\{name} (If a third-party is used, for example, - # processor-paypal) - # * custom-\\{name} (If an alternative method is used, for example, - # custom-crypto) - # @!attribute [rw] card_bin - # @return [::String] - # Optional. The Bank Identification Number - generally the first 6 or 8 - # digits of the card. - # @!attribute [rw] card_last_four - # @return [::String] - # Optional. The last four digits of the card. - # @!attribute [rw] currency_code - # @return [::String] - # Optional. The currency code in ISO-4217 format. - # @!attribute [rw] value - # @return [::Float] - # Optional. The decimal value of the transaction in the specified currency. - # @!attribute [rw] shipping_value - # @return [::Float] - # Optional. The value of shipping in the specified currency. 0 for free or no - # shipping. - # @!attribute [rw] shipping_address - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Address] - # Optional. Destination address if this transaction involves shipping a - # physical item. - # @!attribute [rw] billing_address - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Address] - # Optional. Address associated with the payment method when applicable. - # @!attribute [rw] user - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::User] - # Optional. Information about the user paying/initiating the transaction. - # @!attribute [rw] merchants - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::User>] - # Optional. Information about the user or users fulfilling the transaction. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::Item>] - # Optional. Items purchased in this transaction. - # @!attribute [rw] gateway_info - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TransactionData::GatewayInfo] - # Optional. Information about the payment gateway's response to the - # transaction. - class TransactionData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Structured address format for billing and shipping addresses. - # @!attribute [rw] recipient - # @return [::String] - # Optional. The recipient name, potentially including information such as - # "care of". - # @!attribute [rw] address - # @return [::Array<::String>] - # Optional. The first lines of the address. The first line generally - # contains the street name and number, and further lines may include - # information such as an apartment number. - # @!attribute [rw] locality - # @return [::String] - # Optional. The town/city of the address. - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. The state, province, or otherwise administrative area of the - # address. - # @!attribute [rw] region_code - # @return [::String] - # Optional. The CLDR country/region of the address. - # @!attribute [rw] postal_code - # @return [::String] - # Optional. The postal or ZIP code of the address. - class Address - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about a user's account involved in the transaction. - # @!attribute [rw] account_id - # @return [::String] - # Optional. Unique account identifier for this user. If using account - # defender, this should match the hashed_account_id field. Otherwise, a - # unique and persistent identifier for this account. - # @!attribute [rw] creation_ms - # @return [::Integer] - # Optional. The epoch milliseconds of the user's account creation. - # @!attribute [rw] email - # @return [::String] - # Optional. The email address of the user. - # @!attribute [rw] email_verified - # @return [::Boolean] - # Optional. Whether the email has been verified to be accessible by the - # user (OTP or similar). - # @!attribute [rw] phone_number - # @return [::String] - # Optional. The phone number of the user, with country code. - # @!attribute [rw] phone_verified - # @return [::Boolean] - # Optional. Whether the phone number has been verified to be accessible by - # the user (OTP or similar). - class User - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Line items being purchased in this transaction. - # @!attribute [rw] name - # @return [::String] - # Optional. The full name of the item. - # @!attribute [rw] value - # @return [::Float] - # Optional. The value per item that the user is paying, in the transaction - # currency, after discounts. - # @!attribute [rw] quantity - # @return [::Integer] - # Optional. The quantity of this item that is being purchased. - # @!attribute [rw] merchant_account_id - # @return [::String] - # Optional. When a merchant is specified, its corresponding account_id. - # Necessary to populate marketplace-style transactions. - class Item - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about the transaction from the gateway. - # @!attribute [rw] name - # @return [::String] - # Optional. Name of the gateway service (for example, stripe, square, - # paypal). - # @!attribute [rw] gateway_response_code - # @return [::String] - # Optional. Gateway response code describing the state of the transaction. - # @!attribute [rw] avs_response_code - # @return [::String] - # Optional. AVS response code from the gateway - # (available only when reCAPTCHA Enterprise is called after authorization). - # @!attribute [rw] cvv_response_code - # @return [::String] - # Optional. CVV response code from the gateway - # (available only when reCAPTCHA Enterprise is called after authorization). - class GatewayInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # User information associated with a request protected by reCAPTCHA Enterprise. - # @!attribute [rw] create_account_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Creation time for this account associated with this user. Leave - # blank for non logged-in actions, guest checkout, or when there is no - # account associated with the current user. - # @!attribute [rw] account_id - # @return [::String] - # Optional. For logged-in requests or login/registration requests, the unique - # account identifier associated with this user. You can use the username if - # it is stable (meaning it is the same for every request associated with the - # same user), or any stable user ID of your choice. Leave blank for non - # logged-in actions or guest checkout. - # @!attribute [rw] user_ids - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::UserId>] - # Optional. Identifiers associated with this user or request. - class UserInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An identifier associated with a user. - # @!attribute [rw] email - # @return [::String] - # Optional. An email address. - # - # Note: The following fields are mutually exclusive: `email`, `phone_number`, `username`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] phone_number - # @return [::String] - # Optional. A phone number. Should use the E.164 format. - # - # Note: The following fields are mutually exclusive: `phone_number`, `email`, `username`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] username - # @return [::String] - # Optional. A unique username, if different from all the other identifiers - # and `account_id` that are provided. Can be a unique login handle or - # display name for a user. - # - # Note: The following fields are mutually exclusive: `username`, `email`, `phone_number`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class UserId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Risk analysis result for an event. - # @!attribute [r] score - # @return [::Float] - # Output only. Legitimate event score from 0.0 to 1.0. - # (1.0 means very likely legitimate traffic while 0.0 means very likely - # non-legitimate traffic). - # @!attribute [r] reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis::ClassificationReason>] - # Output only. Reasons contributing to the risk analysis verdict. - # @!attribute [r] extended_verdict_reasons - # @return [::Array<::String>] - # Output only. Extended verdict reasons to be used for experimentation only. - # The set of possible reasons is subject to change. - # @!attribute [r] challenge - # @return [::Google::Cloud::RecaptchaEnterprise::V1::RiskAnalysis::Challenge] - # Output only. Challenge information for POLICY_BASED_CHALLENGE and INVISIBLE - # keys. - # @!attribute [r] verified_bots - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::Bot>] - # Output only. Bots with identities that have been verified by reCAPTCHA and - # detected in the event. - class RiskAnalysis - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reasons contributing to the risk analysis verdict. - # Ensure that applications can handle values not explicitly listed. - module ClassificationReason - # Default unspecified type. - CLASSIFICATION_REASON_UNSPECIFIED = 0 - - # Interactions matched the behavior of an automated agent. - AUTOMATION = 1 - - # The event originated from an illegitimate environment. - UNEXPECTED_ENVIRONMENT = 2 - - # Traffic volume from the event source is higher than normal. - TOO_MUCH_TRAFFIC = 3 - - # Interactions with the site were significantly different than expected - # patterns. - UNEXPECTED_USAGE_PATTERNS = 4 - - # Too little traffic has been received from this site thus far to generate - # quality risk analysis. - LOW_CONFIDENCE_SCORE = 5 - - # The request matches behavioral characteristics of a carding attack. - SUSPECTED_CARDING = 6 - - # The request matches behavioral characteristics of chargebacks for fraud. - SUSPECTED_CHARGEBACK = 7 - end - - # Challenge information for POLICY_BASED_CHALLENGE and INVISIBLE keys. - # Ensure that applications can handle values not explicitly listed. - module Challenge - # Default unspecified type. - CHALLENGE_UNSPECIFIED = 0 - - # No challenge was presented for solving. - NOCAPTCHA = 1 - - # A solution was submitted that was correct. - PASSED = 2 - - # A solution was submitted that was incorrect or otherwise - # deemed suspicious. - FAILED = 3 - end - end - - # Bot information and metadata. - # @!attribute [rw] name - # @return [::String] - # Optional. Enumerated string value that indicates the identity of the bot, - # formatted in kebab-case. - # @!attribute [rw] bot_type - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Bot::BotType] - # Optional. Enumerated field representing the type of bot. - class Bot - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of bots. - # Ensure that applications can handle values not explicitly listed. - module BotType - # Default unspecified type. - BOT_TYPE_UNSPECIFIED = 0 - - # Software program that interacts with a site and performs tasks - # autonomously. - AI_AGENT = 1 - - # Software that extracts specific data from sites for use. - CONTENT_SCRAPER = 2 - - # Software that crawls sites and stores content for the purpose of - # efficient retrieval, likely as part of a search engine. - SEARCH_INDEXER = 3 - end - end - - # Properties of the provided event token. - # @!attribute [r] valid - # @return [::Boolean] - # Output only. Whether the provided user response token is valid. When valid - # = false, the reason could be specified in invalid_reason or it could also - # be due to a user failing to solve a challenge or a sitekey mismatch (i.e - # the sitekey used to generate the token was different than the one specified - # in the assessment). - # @!attribute [r] invalid_reason - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TokenProperties::InvalidReason] - # Output only. Reason associated with the response when valid = false. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp corresponding to the generation of the token. - # @!attribute [r] hostname - # @return [::String] - # Output only. The hostname of the page on which the token was generated (Web - # keys only). - # @!attribute [r] android_package_name - # @return [::String] - # Output only. The name of the Android package with which the token was - # generated (Android keys only). - # @!attribute [r] ios_bundle_id - # @return [::String] - # Output only. The ID of the iOS bundle with which the token was generated - # (iOS keys only). - # @!attribute [r] action - # @return [::String] - # Output only. Action name provided at token generation. - class TokenProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the types of invalid token reasons. - # Ensure that applications can handle values not explicitly listed. - module InvalidReason - # Default unspecified type. - INVALID_REASON_UNSPECIFIED = 0 - - # If the failure reason was not accounted for. - UNKNOWN_INVALID_REASON = 1 - - # The provided user verification token was malformed. - MALFORMED = 2 - - # The user verification token had expired. - EXPIRED = 3 - - # The user verification had already been seen. - DUPE = 4 - - # The user verification token was not present. - MISSING = 5 - - # A retriable error (such as network failure) occurred on the browser. - # Could easily be simulated by an attacker. - BROWSER_ERROR = 6 - - # The action provided at token generation was different than - # the `expected_action` in the assessment request. The comparison is - # case-insensitive. This reason can only be returned if all of the - # following are true: - # - # - your `site_key` has the POLICY_BASED_CHALLENGE integration type - # - you set an action score threshold higher than 0.0 - # - you provided a non-empty `expected_action` - UNEXPECTED_ACTION = 7 - end - end - - # Assessment for Fraud Prevention. - # @!attribute [r] transaction_risk - # @return [::Float] - # Output only. Probability of this transaction being fraudulent. Summarizes - # the combined risk of attack vectors below. Values are from 0.0 (lowest) - # to 1.0 (highest). - # @!attribute [r] risk_reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::RiskReason>] - # Output only. Reasons why the transaction is probably fraudulent and - # received a high transaction risk score. - # @!attribute [r] stolen_instrument_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::StolenInstrumentVerdict] - # Output only. Assessment of this transaction for risk of a stolen - # instrument. - # @!attribute [r] card_testing_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::CardTestingVerdict] - # Output only. Assessment of this transaction for risk of being part of a - # card testing attack. - # @!attribute [r] behavioral_trust_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::BehavioralTrustVerdict] - # Output only. Assessment of this transaction for behavioral trust. - class FraudPreventionAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Risk reasons applicable to the Fraud Prevention assessment. - # @!attribute [r] reason - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudPreventionAssessment::RiskReason::Reason] - # Output only. Risk reasons applicable to the Fraud Prevention assessment. - class RiskReason - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Risk reasons applicable to the Fraud Prevention assessment. New risk - # reasons will be added over time. - module Reason - # Default unspecified type. - REASON_UNSPECIFIED = 0 - - # A suspiciously high number of recent transactions have used identifiers - # present in this transaction. - HIGH_TRANSACTION_VELOCITY = 1 - - # User is cycling through a suspiciously large number of identifiers, - # suggesting enumeration or validation attacks within a potential fraud - # network. - EXCESSIVE_ENUMERATION_PATTERN = 2 - - # User has a short history or no history in the reCAPTCHA network, - # suggesting the possibility of synthetic identity generation. - SHORT_IDENTITY_HISTORY = 3 - - # Identifiers used in this transaction originate from an unusual or - # conflicting set of geolocations. - GEOLOCATION_DISCREPANCY = 4 - - # This transaction is linked to a cluster of known fraudulent activity. - ASSOCIATED_WITH_FRAUD_CLUSTER = 5 - end - end - - # Information about stolen instrument fraud, where the user is not the - # legitimate owner of the instrument being used for the purchase. - # @!attribute [r] risk - # @return [::Float] - # Output only. Probability of this transaction being executed with a stolen - # instrument. Values are from 0.0 (lowest) to 1.0 (highest). - class StolenInstrumentVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about card testing fraud, where an adversary is testing - # fraudulently obtained cards or brute forcing their details. - # @!attribute [r] risk - # @return [::Float] - # Output only. Probability of this transaction attempt being part of a card - # testing attack. Values are from 0.0 (lowest) to 1.0 (highest). - class CardTestingVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about behavioral trust of the transaction. - # @!attribute [r] trust - # @return [::Float] - # Output only. Probability of this transaction attempt being executed in a - # behaviorally trustworthy way. Values are from 0.0 (lowest) to 1.0 - # (highest). - class BehavioralTrustVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Fraud signals describing users and cards involved in the transaction. - # @!attribute [r] user_signals - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::UserSignals] - # Output only. Signals describing the end user in this transaction. - # @!attribute [r] card_signals - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::CardSignals] - # Output only. Signals describing the payment card or cards used in this - # transaction. - class FraudSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Signals describing the user involved in this transaction. - # @!attribute [r] active_days_lower_bound - # @return [::Integer] - # Output only. This user (based on email, phone, and other identifiers) has - # been seen on the internet for at least this number of days. - # @!attribute [r] synthetic_risk - # @return [::Float] - # Output only. Likelihood (from 0.0 to 1.0) this user includes synthetic - # components in their identity, such as a randomly generated email address, - # temporary phone number, or fake shipping address. - class UserSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Signals describing the payment card used in this transaction. - # @!attribute [r] card_labels - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FraudSignals::CardSignals::CardLabel>] - # Output only. The labels for the payment card in this transaction. - class CardSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Risk labels describing the card being assessed, such as its funding - # mechanism. - # Ensure that applications can handle values not explicitly listed. - module CardLabel - # No label specified. - CARD_LABEL_UNSPECIFIED = 0 - - # This card has been detected as prepaid. - PREPAID = 1 - - # This card has been detected as virtual, such as a card number generated - # for a single transaction or merchant. - VIRTUAL = 2 - - # This card has been detected as being used in an unexpected geographic - # location. - UNEXPECTED_LOCATION = 3 - end - end - end - - # Information about SMS toll fraud. - # @!attribute [r] risk - # @return [::Float] - # Output only. Probability of an SMS event being fraudulent. - # Values are from 0.0 (lowest) to 1.0 (highest). - # @!attribute [r] reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::SmsTollFraudVerdict::SmsTollFraudReason>] - # Output only. Reasons contributing to the SMS toll fraud verdict. - class SmsTollFraudVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reasons contributing to the SMS toll fraud verdict. - # Ensure that applications can handle values not explicitly listed. - module SmsTollFraudReason - # Default unspecified reason - SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0 - - # The provided phone number was invalid - INVALID_PHONE_NUMBER = 1 - end - end - - # Assessment for Phone Fraud - # @!attribute [r] sms_toll_fraud_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1::SmsTollFraudVerdict] - # Output only. Assessment of this phone event for risk of SMS toll fraud. - class PhoneFraudAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Account defender risk assessment. - # @!attribute [r] labels - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AccountDefenderAssessment::AccountDefenderLabel>] - # Output only. Labels for this request. - class AccountDefenderAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Labels returned by account defender for this request. - # Ensure that applications can handle values not explicitly listed. - module AccountDefenderLabel - # Default unspecified type. - ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0 - - # The request matches a known good profile for the user. - PROFILE_MATCH = 1 - - # The request is potentially a suspicious login event and must be further - # verified either through multi-factor authentication or another system. - SUSPICIOUS_LOGIN_ACTIVITY = 2 - - # The request matched a profile that previously had suspicious account - # creation behavior. This can mean that this is a fake account. - SUSPICIOUS_ACCOUNT_CREATION = 3 - - # The account in the request has a high number of related accounts. It does - # not necessarily imply that the account is bad but can require further - # investigation. - RELATED_ACCOUNTS_NUMBER_HIGH = 4 - end - end - - # The create key request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which the key is created, in the - # format `projects/{project}`. - # @!attribute [rw] key - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # Required. Information to create a reCAPTCHA Enterprise key. - class CreateKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The list keys request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project that contains the keys that is - # listed, in the format `projects/{project}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of keys to return. Default is 10. Max limit is - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous. - # ListKeysRequest, if any. - class ListKeysRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to request to list keys in a project. - # @!attribute [rw] keys - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::Key>] - # Key details. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results. It is set to empty if no keys - # remain in results. - class ListKeysResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The retrieve legacy secret key request message. - # @!attribute [rw] key - # @return [::String] - # Required. The public key name linked to the requested secret key in the - # format `projects/{project}/keys/{key}`. - class RetrieveLegacySecretKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The get key request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested key, in the format - # `projects/{project}/keys/{key}`. - class GetKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The update key request message. - # @!attribute [rw] key - # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key] - # Required. The key to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields of the key get updated. If the - # mask is not present, all fields are updated. - class UpdateKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The delete key request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the key to be deleted, in the format - # `projects/{project}/keys/{key}`. - class DeleteKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The create firewall policy request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project this policy applies to, in the format - # `projects/{project}`. - # @!attribute [rw] firewall_policy - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # Required. Information to create the policy. - class CreateFirewallPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The list firewall policies request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project to list the policies for, in the format - # `projects/{project}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of policies to return. Default is 10. Max - # limit is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous. - # ListFirewallPoliciesRequest, if any. - class ListFirewallPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to request to list firewall policies belonging to a project. - # @!attribute [rw] firewall_policies - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>] - # Policy details. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results. It is set to empty if no - # policies remain in results. - class ListFirewallPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The get firewall policy request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested policy, in the format - # `projects/{project}/firewallpolicies/{firewallpolicy}`. - class GetFirewallPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The update firewall policy request message. - # @!attribute [rw] firewall_policy - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # Required. The policy to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields of the policy get updated. If - # the mask is not present, all fields are updated. - class UpdateFirewallPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The delete firewall policy request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the policy to be deleted, in the format - # `projects/{project}/firewallpolicies/{firewallpolicy}`. - class DeleteFirewallPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The reorder firewall policies request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project to list the policies for, in the format - # `projects/{project}`. - # @!attribute [rw] names - # @return [::Array<::String>] - # Required. A list containing all policy names, in the new order. Each name - # is in the format `projects/{project}/firewallpolicies/{firewallpolicy}`. - class ReorderFirewallPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The reorder firewall policies response message. - class ReorderFirewallPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The migrate key request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the key to be migrated, in the format - # `projects/{project}/keys/{key}`. - # @!attribute [rw] skip_billing_check - # @return [::Boolean] - # Optional. If true, skips the billing check. - # A reCAPTCHA Enterprise key or migrated key behaves differently than a - # reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see - # https://docs.cloud.google.com/recaptcha/quotas#quota_limit). To avoid - # any disruption of your usage, we check that a billing account is present. - # If your usage of reCAPTCHA is under the free quota, you can safely skip the - # billing check and proceed with the migration. See - # https://cloud.google.com/recaptcha/docs/billing-information. - class MigrateKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The get metrics request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the requested metrics, in the format - # `projects/{project}/keys/{key}/metrics`. - class GetMetricsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metrics for a single Key. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The name of the metrics, in the format - # `projects/{project}/keys/{key}/metrics`. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Inclusive start time aligned to a day in the America/Los_Angeles (Pacific) - # timezone. - # @!attribute [rw] score_metrics - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ScoreMetrics>] - # Metrics are continuous and in order by dates, and in the granularity - # of day. All Key types should have score-based data. - # @!attribute [rw] challenge_metrics - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ChallengeMetrics>] - # Metrics are continuous and in order by dates, and in the granularity - # of day. Only challenge-based keys (CHECKBOX, INVISIBLE) have - # challenge-based data. - class Metrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Secret key is used only in legacy reCAPTCHA. It must be used in a 3rd party - # integration with legacy reCAPTCHA. - # @!attribute [rw] legacy_secret_key - # @return [::String] - # The secret key (also known as shared secret) authorizes communication - # between your application backend and the reCAPTCHA Enterprise server to - # create an assessment. - # The secret key needs to be kept safe for security purposes. - class RetrieveLegacySecretKeyResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A key used to identify and configure applications (web and/or mobile) that - # use reCAPTCHA Enterprise. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for the Key in the format - # `projects/{project}/keys/{key}`. - # @!attribute [rw] display_name - # @return [::String] - # Required. Human-readable display name of this key. Modifiable by user. - # @!attribute [rw] web_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings] - # Settings for keys that can be used by websites. - # - # Note: The following fields are mutually exclusive: `web_settings`, `android_settings`, `ios_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] android_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AndroidKeySettings] - # Settings for keys that can be used by Android apps. - # - # Note: The following fields are mutually exclusive: `android_settings`, `web_settings`, `ios_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ios_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::IOSKeySettings] - # Settings for keys that can be used by iOS apps. - # - # Note: The following fields are mutually exclusive: `ios_settings`, `web_settings`, `android_settings`, `express_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] express_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::ExpressKeySettings] - # Settings for keys that can be used by reCAPTCHA Express. - # - # Note: The following fields are mutually exclusive: `express_settings`, `web_settings`, `android_settings`, `ios_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. See [Creating and managing labels] - # (https://cloud.google.com/recaptcha/docs/labels). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp corresponding to the creation of this key. - # @!attribute [rw] testing_options - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions] - # Optional. Options for user acceptance testing. - # @!attribute [rw] waf_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings] - # Optional. Settings for Web Application Firewall (WAF). - class Key - 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 - - # Options for user acceptance testing. - # @!attribute [rw] testing_score - # @return [::Float] - # Optional. All assessments for this Key return this score. Must be between 0 - # (likely not legitimate) and 1 (likely legitimate) inclusive. - # @!attribute [rw] testing_challenge - # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions::TestingChallenge] - # Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all - # challenge requests for this site return nocaptcha if NOCAPTCHA, or an - # unsolvable challenge if CHALLENGE. - class TestingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the challenge option for challenge-based (for example, - # CHECKBOX and INVISIBLE) testing keys. - # Ensure that applications can handle values not explicitly listed. - module TestingChallenge - # Perform the normal risk analysis and return either nocaptcha or a - # challenge depending on risk and trust factors. - TESTING_CHALLENGE_UNSPECIFIED = 0 - - # Challenge requests for this key always return a nocaptcha, which - # does not require a solution. - NOCAPTCHA = 1 - - # Challenge requests for this key always return an unsolvable - # challenge. - UNSOLVABLE_CHALLENGE = 2 - end - end - - # Settings specific to keys that can be used by websites. - # @!attribute [rw] allow_all_domains - # @return [::Boolean] - # Optional. If set to true, it means allowed_domains are not enforced. - # @!attribute [rw] allowed_domains - # @return [::Array<::String>] - # Optional. Domains or subdomains of websites allowed to use the key. All - # subdomains of an allowed domain are automatically allowed. A valid domain - # requires a host and must not include any path, port, query or fragment. - # Examples: 'example.com' or 'subdomain.example.com' - # Each key supports a maximum of 250 domains. To use a key on more domains, - # set `allow_all_domains` to true. When this is set, you are responsible for - # validating the hostname by checking the `token_properties.hostname` field - # in each assessment response against your list of allowed domains. - # @!attribute [rw] allow_amp_traffic - # @return [::Boolean] - # Optional. If set to true, the key can be used on AMP (Accelerated Mobile - # Pages) websites. This is supported only for the SCORE integration type. - # @!attribute [rw] integration_type - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::IntegrationType] - # Required. Describes how this key is integrated with the website. - # @!attribute [rw] challenge_security_preference - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ChallengeSecurityPreference] - # Optional. Settings for the frequency and difficulty at which this key - # triggers captcha challenges. This should only be specified for - # `IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE. - # @!attribute [rw] challenge_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ChallengeSettings] - # Optional. Challenge settings. - class WebKeySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Per-action challenge settings. - # @!attribute [rw] score_threshold - # @return [::Float] - # Required. A challenge is triggered if the end-user score is below that - # threshold. Value must be between 0 and 1 (inclusive). - class ActionSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for POLICY_BASED_CHALLENGE keys to control when a challenge is - # triggered. - # @!attribute [rw] default_settings - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings] - # Required. Defines when a challenge is triggered (unless the default - # threshold is overridden for the given action, see `action_settings`). - # @!attribute [rw] action_settings - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings}] - # Optional. The action to score threshold map. - # The action name should be the same as the action name passed in the - # `data-action` attribute - # (see https://cloud.google.com/recaptcha/docs/actions-website). - # Action names are case-insensitive. - # There is a maximum of 100 action settings. - # An action name has a maximum length of 100. - class ChallengeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::ActionSettings] - class ActionSettingsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Enum that represents the integration types for web keys. - # Ensure that applications can handle values not explicitly listed. - module IntegrationType - # Default type that indicates this enum hasn't been specified. This is not - # a valid IntegrationType, one of the other types must be specified - # instead. - INTEGRATION_TYPE_UNSPECIFIED = 0 - - # Only used to produce scores. It doesn't display the "I'm not a robot" - # checkbox and never shows captcha challenges. - SCORE = 1 - - # Displays the "I'm not a robot" checkbox and may show captcha challenges - # after it is checked. - CHECKBOX = 2 - - # Doesn't display the "I'm not a robot" checkbox, but may show captcha - # challenges after risk analysis. - INVISIBLE = 3 - - # Displays a visual challenge or not depending on the user risk analysis - # score. - POLICY_BASED_CHALLENGE = 5 - end - - # Enum that represents the possible challenge frequency and difficulty - # configurations for a web key. - # Ensure that applications can handle values not explicitly listed. - module ChallengeSecurityPreference - # Default type that indicates this enum hasn't been specified. - CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0 - - # Key tends to show fewer and easier challenges. - USABILITY = 1 - - # Key tends to show balanced (in amount and difficulty) challenges. - BALANCE = 2 - - # Key tends to show more and harder challenges. - SECURITY = 3 - end - end - - # Settings specific to keys that can be used by Android apps. - # @!attribute [rw] allow_all_package_names - # @return [::Boolean] - # Optional. If set to true, allowed_package_names are not enforced. - # @!attribute [rw] allowed_package_names - # @return [::Array<::String>] - # Optional. Android package names of apps allowed to use the key. - # Example: 'com.companyname.appname' - # Each key supports a maximum of 250 package names. To use a key on more - # apps, set `allow_all_package_names` to true. When this is set, you - # are responsible for validating the package name by checking the - # `token_properties.android_package_name` field in each assessment response - # against your list of allowed package names. - # @!attribute [rw] support_non_google_app_store_distribution - # @return [::Boolean] - # Optional. Set to true for keys that are used in an Android application that - # is available for download in app stores in addition to the Google Play - # Store. - class AndroidKeySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings specific to keys that can be used by iOS apps. - # @!attribute [rw] allow_all_bundle_ids - # @return [::Boolean] - # Optional. If set to true, allowed_bundle_ids are not enforced. - # @!attribute [rw] allowed_bundle_ids - # @return [::Array<::String>] - # Optional. iOS bundle IDs of apps allowed to use the key. - # Example: 'com.companyname.productname.appname' - # Each key supports a maximum of 250 bundle IDs. To use a key on more - # apps, set `allow_all_bundle_ids` to true. When this is set, you - # are responsible for validating the bundle id by checking the - # `token_properties.ios_bundle_id` field in each assessment response - # against your list of allowed bundle IDs. - # @!attribute [rw] apple_developer_id - # @return [::Google::Cloud::RecaptchaEnterprise::V1::AppleDeveloperId] - # Optional. Apple Developer account details for the app that is protected by - # the reCAPTCHA Key. reCAPTCHA leverages platform-specific checks like Apple - # App Attest and Apple DeviceCheck to protect your app from abuse. Providing - # these fields allows reCAPTCHA to get a better assessment of the integrity - # of your app. - class IOSKeySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings specific to keys that can be used for reCAPTCHA Express. - class ExpressKeySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains fields that are required to perform Apple-specific integrity checks. - # @!attribute [rw] private_key - # @return [::String] - # Required. Input only. A private key (downloaded as a text file with a .p8 - # file extension) generated for your Apple Developer account. Ensure that - # Apple DeviceCheck is enabled for the private key. - # @!attribute [rw] key_id - # @return [::String] - # Required. The Apple developer key ID (10-character string). - # @!attribute [rw] team_id - # @return [::String] - # Required. The Apple team ID (10-character string) owning the provisioning - # profile used to build your application. - class AppleDeveloperId - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Score distribution. - # @!attribute [rw] score_buckets - # @return [::Google::Protobuf::Map{::Integer => ::Integer}] - # Map key is score value multiplied by 100. The scores are discrete values - # between [0, 1]. The maximum number of buckets is on order of a few dozen, - # but typically much lower (ie. 10). - class ScoreDistribution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::Integer] - # @!attribute [rw] value - # @return [::Integer] - class ScoreBucketsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metrics related to scoring. - # @!attribute [rw] overall_metrics - # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution] - # Aggregated score metrics for all traffic. - # @!attribute [rw] action_metrics - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution}] - # Action-based metrics. The map key is the action name which specified by the - # site owners at time of the "execute" client-side call. - class ScoreMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution] - class ActionMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metrics related to challenges. - # @!attribute [rw] pageload_count - # @return [::Integer] - # Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent - # to a count of pageloads for pages that include reCAPTCHA. - # @!attribute [rw] nocaptcha_count - # @return [::Integer] - # Count of nocaptchas (successful verification without a challenge) issued. - # @!attribute [rw] failed_count - # @return [::Integer] - # Count of submitted challenge solutions that were incorrect or otherwise - # deemed suspicious such that a subsequent challenge was triggered. - # @!attribute [rw] passed_count - # @return [::Integer] - # Count of nocaptchas (successful verification without a challenge) plus - # submitted challenge solutions that were correct and resulted in - # verification. - class ChallengeMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Policy config assessment. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. If the processing of a policy config fails, an error is - # populated and the firewall_policy is left empty. - # @!attribute [r] firewall_policy - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy] - # Output only. The policy that matched the request. If more than one policy - # may match, this is the first match. If no policy matches the incoming - # request, the policy field is left empty. - class FirewallPolicyAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An individual action. Each action represents what to do if a policy - # matches. - # @!attribute [rw] allow - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::AllowAction] - # The user request did not match any policy and should be allowed - # access to the requested resource. - # - # Note: The following fields are mutually exclusive: `allow`, `block`, `include_recaptcha_script`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] block - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::BlockAction] - # This action denies access to a given page. The user gets an HTTP - # error code. - # - # Note: The following fields are mutually exclusive: `block`, `allow`, `include_recaptcha_script`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] include_recaptcha_script - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::IncludeRecaptchaScriptAction] - # This action injects reCAPTCHA JavaScript code into the HTML page - # returned by the site backend. - # - # Note: The following fields are mutually exclusive: `include_recaptcha_script`, `allow`, `block`, `redirect`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] redirect - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::RedirectAction] - # This action redirects the request to a reCAPTCHA interstitial to - # attach a token. - # - # Note: The following fields are mutually exclusive: `redirect`, `allow`, `block`, `include_recaptcha_script`, `substitute`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] substitute - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::SubstituteAction] - # This action transparently serves a different page to an offending - # user. - # - # Note: The following fields are mutually exclusive: `substitute`, `allow`, `block`, `include_recaptcha_script`, `redirect`, `set_header`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] set_header - # @return [::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction::SetHeaderAction] - # This action sets a custom header but allow the request to continue - # to the customer backend. - # - # Note: The following fields are mutually exclusive: `set_header`, `allow`, `block`, `include_recaptcha_script`, `redirect`, `substitute`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class FirewallAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An allow action continues processing a request unimpeded. - class AllowAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A block action serves an HTTP error code a prevents the request from - # hitting the backend. - class BlockAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An include reCAPTCHA script action involves injecting reCAPTCHA JavaScript - # code into the HTML returned by the site backend. This reCAPTCHA - # script is tasked with collecting user signals on the requested web page, - # issuing tokens as a cookie within the site domain, and enabling their - # utilization in subsequent page requests. - class IncludeRecaptchaScriptAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A redirect action returns a 307 (temporary redirect) response, pointing - # the user to a reCAPTCHA interstitial page to attach a token. - class RedirectAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A substitute action transparently serves a different page than the one - # requested. - # @!attribute [rw] path - # @return [::String] - # Optional. The address to redirect to. The target is a relative path in - # the current host. Example: "/blog/404.html". - class SubstituteAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A set header action sets a header and forwards the request to the - # backend. This can be used to trigger custom protection implemented on the - # backend. - # @!attribute [rw] key - # @return [::String] - # Optional. The header key to set in the request to the backend server. - # @!attribute [rw] value - # @return [::String] - # Optional. The header value to set in the request to the backend server. - class SetHeaderAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A FirewallPolicy represents a single matching pattern and resulting actions - # to take. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name for the FirewallPolicy in the format - # `projects/{project}/firewallpolicies/{firewallpolicy}`. - # @!attribute [rw] description - # @return [::String] - # Optional. A description of what this policy aims to achieve, for - # convenience purposes. The description can at most include 256 UTF-8 - # characters. - # @!attribute [rw] path - # @return [::String] - # Optional. The path for which this policy applies, specified as a glob - # pattern. For more information on glob, see the [manual - # page](https://man7.org/linux/man-pages/man7/glob.7.html). - # A path has a max length of 200 characters. - # @!attribute [rw] condition - # @return [::String] - # Optional. A CEL (Common Expression Language) conditional expression that - # specifies if this policy applies to an incoming user request. If this - # condition evaluates to true and the requested path matched the path - # pattern, the associated actions should be executed by the caller. The - # condition string is checked for CEL syntax correctness on creation. For - # more information, see the [CEL spec](https://github.com/google/cel-spec) - # and its [language - # definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md). - # A condition has a max length of 500 characters. - # @!attribute [rw] actions - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::FirewallAction>] - # Optional. The actions that the caller should take regarding user access. - # There should be at most one terminal action. A terminal action is any - # action that forces a response, such as `AllowAction`, - # `BlockAction` or `SubstituteAction`. - # Zero or more non-terminal actions such as `SetHeader` might be - # specified. A single policy can contain up to 16 actions. - class FirewallPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to list memberships in a related account group. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name for the related account group in the format - # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of accounts to return. The service might - # return fewer than this value. If unspecified, at most 50 accounts are - # returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous - # `ListRelatedAccountGroupMemberships` call. - # - # When paginating, all other parameters provided to - # `ListRelatedAccountGroupMemberships` must match the call that provided the - # page token. - class ListRelatedAccountGroupMembershipsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to a `ListRelatedAccountGroupMemberships` call. - # @!attribute [rw] related_account_group_memberships - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # The memberships listed by the query. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListRelatedAccountGroupMembershipsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to list related account groups. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project to list related account groups from, in - # the format `projects/{project}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of groups to return. The service might return - # fewer than this value. If unspecified, at most 50 groups are returned. The - # maximum value is 1000; values above 1000 are coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListRelatedAccountGroups` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListRelatedAccountGroups` must match the call that provided the page - # token. - class ListRelatedAccountGroupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to a `ListRelatedAccountGroups` call. - # @!attribute [rw] related_account_groups - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>] - # The groups of related accounts listed by the query. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListRelatedAccountGroupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message to search related account group memberships. - # @!attribute [rw] project - # @return [::String] - # Required. The name of the project to search related account group - # memberships from. Specify the project name in the following format: - # `projects/{project}`. - # @!attribute [rw] account_id - # @return [::String] - # Optional. The unique stable account identifier used to search connections. - # The identifier should correspond to an `account_id` provided in a previous - # `CreateAssessment` or `AnnotateAssessment` call. Either hashed_account_id - # or account_id must be set, but not both. - # @!attribute [rw] hashed_account_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. Deprecated: use `account_id` instead. - # The unique stable hashed account identifier used to search connections. The - # identifier should correspond to a `hashed_account_id` provided in a - # previous `CreateAssessment` or `AnnotateAssessment` call. Either - # hashed_account_id or account_id must be set, but not both. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of groups to return. The service might return - # fewer than this value. If unspecified, at most 50 groups are returned. The - # maximum value is 1000; values above 1000 are coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous - # `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `SearchRelatedAccountGroupMemberships` must match the call that provided - # the page token. - class SearchRelatedAccountGroupMembershipsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to a `SearchRelatedAccountGroupMemberships` call. - # @!attribute [rw] related_account_group_memberships - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>] - # The queried memberships. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class SearchRelatedAccountGroupMembershipsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The AddIpOverride request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the key to which the IP override is added, in the - # format `projects/{project}/keys/{key}`. - # @!attribute [rw] ip_override_data - # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData] - # Required. IP override added to the key. - class AddIpOverrideRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for AddIpOverride. - class AddIpOverrideResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The RemoveIpOverride request message. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the key from which the IP override is removed, in the - # format `projects/{project}/keys/{key}`. - # @!attribute [rw] ip_override_data - # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData] - # Required. IP override to be removed from the key. - class RemoveIpOverrideRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for RemoveIpOverride. - class RemoveIpOverrideResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The ListIpOverrides request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent key for which the IP overrides are listed, in the - # format `projects/{project}/keys/{key}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of overrides to return. Default is 10. Max - # limit is 100. If the number of overrides is less than the page_size, all - # overrides are returned. If the page size is more than 100, it is coerced to - # 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous - # ListIpOverridesRequest, if any. - class ListIpOverridesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListIpOverrides. - # @!attribute [rw] ip_overrides - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData>] - # IP Overrides details. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results. If this field is empty, no keys - # remain in the results. - class ListIpOverridesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A membership in a group of related accounts. - # @!attribute [rw] name - # @return [::String] - # Required. Identifier. The resource name for this membership in the format - # `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. - # @!attribute [rw] account_id - # @return [::String] - # The unique stable account identifier of the member. The identifier - # corresponds to an `account_id` provided in a previous `CreateAssessment` or - # `AnnotateAssessment` call. - # @!attribute [rw] hashed_account_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated: use `account_id` instead. - # The unique stable hashed account identifier of the member. The identifier - # corresponds to a `hashed_account_id` provided in a previous - # `CreateAssessment` or `AnnotateAssessment` call. - class RelatedAccountGroupMembership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A group of related accounts. - # @!attribute [rw] name - # @return [::String] - # Required. Identifier. The resource name for the related account group in - # the format - # `projects/{project}/relatedaccountgroups/{related_account_group}`. - class RelatedAccountGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings specific to keys that can be used for WAF (Web Application - # Firewall). - # @!attribute [rw] waf_service - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings::WafService] - # Required. The Web Application Firewall (WAF) service that uses this key. - # @!attribute [rw] waf_feature - # @return [::Google::Cloud::RecaptchaEnterprise::V1::WafSettings::WafFeature] - # Required. The Web Application Firewall (WAF) feature for which this key is - # enabled. - class WafSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Supported WAF features. For more information, see - # https://cloud.google.com/recaptcha/docs/usecase#comparison_of_features. - # Ensure that applications can handle values not explicitly listed. - module WafFeature - # Undefined feature. - WAF_FEATURE_UNSPECIFIED = 0 - - # Redirects suspicious traffic to reCAPTCHA. - CHALLENGE_PAGE = 1 - - # Use reCAPTCHA session-tokens to protect the whole user session on the - # site's domain. - SESSION_TOKEN = 2 - - # Use reCAPTCHA action-tokens to protect user actions. - ACTION_TOKEN = 3 - - # Deprecated: Use `express_settings` instead. - EXPRESS = 5 - end - - # Web Application Firewalls that reCAPTCHA supports. - # Ensure that applications can handle values not explicitly listed. - module WafService - # Undefined WAF - WAF_SERVICE_UNSPECIFIED = 0 - - # Cloud Armor - CA = 1 - - # Fastly - FASTLY = 3 - - # Cloudflare - CLOUDFLARE = 4 - - # Akamai - AKAMAI = 5 - end - end - - # The environment creating the assessment. This describes your environment - # (the system invoking CreateAssessment), NOT the environment of your user. - # @!attribute [rw] client - # @return [::String] - # Optional. Identifies the client module initiating the CreateAssessment - # request. This can be the link to the client module's project. Examples - # include: - # - # - - # "github.com/GoogleCloudPlatform/recaptcha-enterprise-google-tag-manager" - # - "wordpress.org/plugins/recaptcha-something" - # @!attribute [rw] version - # @return [::String] - # Optional. The version of the client module. For example, "1.0.0". - class AssessmentEnvironment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the IP or IP range override. - # @!attribute [rw] ip - # @return [::String] - # Required. The IP address to override (can be IPv4, IPv6 or CIDR). - # The IP override must be a valid IPv4 or IPv6 address, or a CIDR range. - # The IP override must be a public IP address. - # Example of IPv4: 168.192.5.6 - # Example of IPv6: 2001:0000:130F:0000:0000:09C0:876A:130B - # Example of IPv4 with CIDR: 168.192.5.0/24 - # Example of IPv6 with CIDR: 2001:0DB8:1234::/48 - # @!attribute [rw] override_type - # @return [::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData::OverrideType] - # Required. Describes the type of IP override. - class IpOverrideData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the type of IP override. - # Ensure that applications can handle values not explicitly listed. - module OverrideType - # Default override type that indicates this enum hasn't been specified. - OVERRIDE_TYPE_UNSPECIFIED = 0 - - # Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for - # all valid assessments. - ALLOW = 1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile deleted file mode 100644 index ecbdc5a6605c..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1", path: "../" -else - gem "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb deleted file mode 100644 index 2cd93faef1ad..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/add_ip_override.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the add_ip_override call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override. -# -def add_ip_override - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new - - # Call the add_ip_override method. - result = client.add_ip_override request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb deleted file mode 100644 index a4e7cfd8ae7e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment. -# -def annotate_assessment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new - - # Call the annotate_assessment method. - result = client.annotate_assessment request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb deleted file mode 100644 index 0faeb6dd26ee..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the create_assessment call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment. -# -def create_assessment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new - - # Call the create_assessment method. - result = client.create_assessment request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_policy.rb deleted file mode 100644 index 6161259992c4..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the create_firewall_policy call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy. -# -def create_firewall_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new - - # Call the create_firewall_policy method. - result = client.create_firewall_policy request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb deleted file mode 100644 index 17732dc4f67e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the create_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key. -# -def create_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new - - # Call the create_key method. - result = client.create_key request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_policy.rb deleted file mode 100644 index 4043f5b69b08..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the delete_firewall_policy call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy. -# -def delete_firewall_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new - - # Call the delete_firewall_policy method. - result = client.delete_firewall_policy request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb deleted file mode 100644 index 5303f077ca44..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the delete_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key. -# -def delete_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new - - # Call the delete_key method. - result = client.delete_key request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_policy.rb deleted file mode 100644 index 20c22a7354d8..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the get_firewall_policy call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy. -# -def get_firewall_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new - - # Call the get_firewall_policy method. - result = client.get_firewall_policy request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb deleted file mode 100644 index 4c3b7da228bb..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the get_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key. -# -def get_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new - - # Call the get_key method. - result = client.get_key request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb deleted file mode 100644 index e70958bdf776..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the get_metrics call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics. -# -def get_metrics - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new - - # Call the get_metrics method. - result = client.get_metrics request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb deleted file mode 100644 index cac6a23ab90f..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_firewall_policies.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the list_firewall_policies call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies. -# -def list_firewall_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.new - - # Call the list_firewall_policies method. - result = client.list_firewall_policies request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.rb deleted file mode 100644 index b028a8f6caa4..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_ip_overrides.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the list_ip_overrides call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides. -# -def list_ip_overrides - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.new - - # Call the list_ip_overrides method. - result = client.list_ip_overrides request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb deleted file mode 100644 index 7e6a4cabb356..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the list_keys call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys. -# -def list_keys - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new - - # Call the list_keys method. - result = client.list_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::RecaptchaEnterprise::V1::Key. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb deleted file mode 100644 index ece30d40559d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the list_related_account_group_memberships call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships. -# -def list_related_account_group_memberships - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new - - # Call the list_related_account_group_memberships method. - result = client.list_related_account_group_memberships request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb deleted file mode 100644 index d19c5f95a161..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the list_related_account_groups call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups. -# -def list_related_account_groups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new - - # Call the list_related_account_groups method. - result = client.list_related_account_groups request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb deleted file mode 100644 index 3790cc8bf22d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the migrate_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key. -# -def migrate_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new - - # Call the migrate_key method. - result = client.migrate_key request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb deleted file mode 100644 index 775dae1c3506..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/remove_ip_override.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the remove_ip_override call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override. -# -def remove_ip_override - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new - - # Call the remove_ip_override method. - result = client.remove_ip_override request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb deleted file mode 100644 index 0785a8c5770d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/reorder_firewall_policies.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the reorder_firewall_policies call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies. -# -def reorder_firewall_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new - - # Call the reorder_firewall_policies method. - result = client.reorder_firewall_policies request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb deleted file mode 100644 index a5aff30875f6..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the retrieve_legacy_secret_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key. -# -def retrieve_legacy_secret_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new - - # Call the retrieve_legacy_secret_key method. - result = client.retrieve_legacy_secret_key request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb deleted file mode 100644 index 8ca6af8cafde..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the search_related_account_group_memberships call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships. -# -def search_related_account_group_memberships - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new - - # Call the search_related_account_group_memberships method. - result = client.search_related_account_group_memberships request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - p item - end -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_policy.rb deleted file mode 100644 index 1c0edac34c62..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_firewall_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the update_firewall_policy call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy. -# -def update_firewall_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new - - # Call the update_firewall_policy method. - result = client.update_firewall_policy request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb deleted file mode 100644 index f6b0ed5da093..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] -require "google/cloud/recaptcha_enterprise/v1" - -## -# Snippet for the update_key call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key. -# -def update_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new - - # Call the update_key method. - result = client.update_key request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. - p result -end -# [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json deleted file mode 100644 index 3f47d419cda8..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-recaptcha_enterprise-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.recaptchaenterprise.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync", - "title": "Snippet for the create_assessment call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment.", - "file": "recaptcha_enterprise_service/create_assessment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_assessment", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Assessment", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "CreateAssessment", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync", - "title": "Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment.", - "file": "recaptcha_enterprise_service/annotate_assessment.rb", - "language": "RUBY", - "client_method": { - "short_name": "annotate_assessment", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "AnnotateAssessment", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync", - "title": "Snippet for the create_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key.", - "file": "recaptcha_enterprise_service/create_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "CreateKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync", - "title": "Snippet for the list_keys call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys.", - "file": "recaptcha_enterprise_service/list_keys.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_keys", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ListKeys", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync", - "title": "Snippet for the retrieve_legacy_secret_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key.", - "file": "recaptcha_enterprise_service/retrieve_legacy_secret_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "retrieve_legacy_secret_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "RetrieveLegacySecretKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync", - "title": "Snippet for the get_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key.", - "file": "recaptcha_enterprise_service/get_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "GetKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync", - "title": "Snippet for the update_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key.", - "file": "recaptcha_enterprise_service/update_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "UpdateKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync", - "title": "Snippet for the delete_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key.", - "file": "recaptcha_enterprise_service/delete_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "DeleteKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync", - "title": "Snippet for the migrate_key call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key.", - "file": "recaptcha_enterprise_service/migrate_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "migrate_key", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Key", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "MigrateKey", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AddIpOverride_sync", - "title": "Snippet for the add_ip_override call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override.", - "file": "recaptcha_enterprise_service/add_ip_override.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_ip_override", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#add_ip_override", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "AddIpOverride", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AddIpOverride", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RemoveIpOverride_sync", - "title": "Snippet for the remove_ip_override call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override.", - "file": "recaptcha_enterprise_service/remove_ip_override.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_ip_override", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#remove_ip_override", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "RemoveIpOverride", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RemoveIpOverride", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListIpOverrides_sync", - "title": "Snippet for the list_ip_overrides call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides.", - "file": "recaptcha_enterprise_service/list_ip_overrides.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_ip_overrides", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_ip_overrides", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ListIpOverrides", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListIpOverrides", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync", - "title": "Snippet for the get_metrics call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics.", - "file": "recaptcha_enterprise_service/get_metrics.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_metrics", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::Metrics", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "GetMetrics", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateFirewallPolicy_sync", - "title": "Snippet for the create_firewall_policy call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy.", - "file": "recaptcha_enterprise_service/create_firewall_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_firewall_policy", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_firewall_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "CreateFirewallPolicy", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateFirewallPolicy", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListFirewallPolicies_sync", - "title": "Snippet for the list_firewall_policies call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies.", - "file": "recaptcha_enterprise_service/list_firewall_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_firewall_policies", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_firewall_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ListFirewallPolicies", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListFirewallPolicies", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetFirewallPolicy_sync", - "title": "Snippet for the get_firewall_policy call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy.", - "file": "recaptcha_enterprise_service/get_firewall_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_firewall_policy", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_firewall_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "GetFirewallPolicy", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetFirewallPolicy", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateFirewallPolicy_sync", - "title": "Snippet for the update_firewall_policy call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy.", - "file": "recaptcha_enterprise_service/update_firewall_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_firewall_policy", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_firewall_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "UpdateFirewallPolicy", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateFirewallPolicy", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteFirewallPolicy_sync", - "title": "Snippet for the delete_firewall_policy call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy.", - "file": "recaptcha_enterprise_service/delete_firewall_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_firewall_policy", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_firewall_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "DeleteFirewallPolicy", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteFirewallPolicy", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ReorderFirewallPolicies_sync", - "title": "Snippet for the reorder_firewall_policies call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies.", - "file": "recaptcha_enterprise_service/reorder_firewall_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "reorder_firewall_policies", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#reorder_firewall_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ReorderFirewallPolicies", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ReorderFirewallPolicies", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync", - "title": "Snippet for the list_related_account_groups call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups.", - "file": "recaptcha_enterprise_service/list_related_account_groups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_related_account_groups", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ListRelatedAccountGroups", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync", - "title": "Snippet for the list_related_account_group_memberships call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships.", - "file": "recaptcha_enterprise_service/list_related_account_group_memberships.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_related_account_group_memberships", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "ListRelatedAccountGroupMemberships", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync", - "title": "Snippet for the search_related_account_group_memberships call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships.", - "file": "recaptcha_enterprise_service/search_related_account_group_memberships.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_related_account_group_memberships", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "SearchRelatedAccountGroupMemberships", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb deleted file mode 100644 index 5ace4590a74e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_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/recaptcha_enterprise/v1/recaptcha_enterprise_service" - -class ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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_assessment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assessment_path project: "value0", assessment: "value1" - assert_equal "projects/value0/assessments/value1", path - end - end - - def test_firewall_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.firewall_policy_path project: "value0", firewallpolicy: "value1" - assert_equal "projects/value0/firewallpolicies/value1", path - end - end - - def test_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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.key_path project: "value0", key: "value1" - assert_equal "projects/value0/keys/value1", path - end - end - - def test_metrics_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.metrics_path project: "value0", key: "value1" - assert_equal "projects/value0/keys/value1/metrics", 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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_related_account_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.related_account_group_path project: "value0", relatedaccountgroup: "value1" - assert_equal "projects/value0/relatedaccountgroups/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb deleted file mode 100644 index 0dc007446ff3..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb" -require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service" - -class ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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_assessment - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Assessment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - assessment = {} - - create_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_assessment, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Assessment), request["assessment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_assessment({ parent: parent, assessment: assessment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_assessment parent: parent, assessment: assessment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_assessment({ parent: parent, assessment: assessment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_assessment_client_stub.call_rpc_count - end - end - - def test_annotate_assessment - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - annotation = :ANNOTATION_UNSPECIFIED - reasons = [:REASON_UNSPECIFIED] - account_id = "hello world" - hashed_account_id = "hello world" - transaction_event = {} - phone_authentication_event = {} - - annotate_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :annotate_assessment, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, request - assert_equal "hello world", request["name"] - assert_equal :ANNOTATION_UNSPECIFIED, request["annotation"] - assert_equal [:REASON_UNSPECIFIED], request["reasons"] - assert_equal "hello world", request["account_id"] - assert_equal "hello world", request["hashed_account_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent), request["transaction_event"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::PhoneAuthenticationEvent), request["phone_authentication_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, annotate_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.annotate_assessment name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, account_id: account_id, hashed_account_id: hashed_account_id, transaction_event: transaction_event, phone_authentication_event: phone_authentication_event), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, annotate_assessment_client_stub.call_rpc_count - end - end - - def test_create_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - key = {} - - create_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Key), request["key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_key({ parent: parent, key: key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_key parent: parent, key: key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_key ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new(parent: parent, key: key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_key({ parent: parent, key: key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_key(::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new(parent: parent, key: key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_key_client_stub.call_rpc_count - end - end - - def test_list_keys - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_keys, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest, 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_keys_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_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_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_keys ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.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_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_keys(::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.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_keys_client_stub.call_rpc_count - end - end - - def test_retrieve_legacy_secret_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - key = "hello world" - - retrieve_legacy_secret_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :retrieve_legacy_secret_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest, request - assert_equal "hello world", request["key"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, retrieve_legacy_secret_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.retrieve_legacy_secret_key({ key: key }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.retrieve_legacy_secret_key key: key do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.retrieve_legacy_secret_key ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new(key: key) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.retrieve_legacy_secret_key({ key: key }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.retrieve_legacy_secret_key(::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new(key: key), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, retrieve_legacy_secret_key_client_stub.call_rpc_count - end - end - - def test_get_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_key ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_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_key(::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_key_client_stub.call_rpc_count - end - end - - def test_update_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - key = {} - update_mask = {} - - update_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::Key), request["key"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_key({ key: key, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_key key: key, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_key ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new(key: key, 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_key({ key: key, 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_key(::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new(key: key, 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_key_client_stub.call_rpc_count - end - end - - def test_delete_key - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_key ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_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.delete_key(::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new(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_key_client_stub.call_rpc_count - end - end - - def test_migrate_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Key.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - skip_billing_check = true - - migrate_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :migrate_key, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["skip_billing_check"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, migrate_key_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.migrate_key({ name: name, skip_billing_check: skip_billing_check }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.migrate_key name: name, skip_billing_check: skip_billing_check do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.migrate_key ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new(name: name, skip_billing_check: skip_billing_check) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.migrate_key({ name: name, skip_billing_check: skip_billing_check }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.migrate_key(::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new(name: name, skip_billing_check: skip_billing_check), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, migrate_key_client_stub.call_rpc_count - end - end - - def test_add_ip_override - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ip_override_data = {} - - add_ip_override_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_ip_override, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData), request["ip_override_data"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_ip_override_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_ip_override({ name: name, ip_override_data: ip_override_data }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_ip_override name: name, ip_override_data: ip_override_data do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_ip_override ::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new(name: name, ip_override_data: ip_override_data) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_ip_override({ name: name, ip_override_data: ip_override_data }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_ip_override(::Google::Cloud::RecaptchaEnterprise::V1::AddIpOverrideRequest.new(name: name, ip_override_data: ip_override_data), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_ip_override_client_stub.call_rpc_count - end - end - - def test_remove_ip_override - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ip_override_data = {} - - remove_ip_override_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_ip_override, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::IpOverrideData), request["ip_override_data"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_ip_override_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_ip_override({ name: name, ip_override_data: ip_override_data }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_ip_override name: name, ip_override_data: ip_override_data do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_ip_override ::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new(name: name, ip_override_data: ip_override_data) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_ip_override({ name: name, ip_override_data: ip_override_data }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_ip_override(::Google::Cloud::RecaptchaEnterprise::V1::RemoveIpOverrideRequest.new(name: name, ip_override_data: ip_override_data), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_ip_override_client_stub.call_rpc_count - end - end - - def test_list_ip_overrides - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_ip_overrides_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_ip_overrides, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest, 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_ip_overrides_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_ip_overrides({ parent: parent, page_size: page_size, page_token: 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_ip_overrides parent: parent, page_size: page_size, page_token: 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_ip_overrides ::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.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_ip_overrides({ 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_ip_overrides(::Google::Cloud::RecaptchaEnterprise::V1::ListIpOverridesRequest.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_ip_overrides_client_stub.call_rpc_count - end - end - - def test_get_metrics - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::Metrics.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_metrics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_metrics, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_metrics_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_metrics({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_metrics name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_metrics ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_metrics({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_metrics(::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_metrics_client_stub.call_rpc_count - end - end - - def test_create_firewall_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - firewall_policy = {} - - create_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_firewall_policy, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy), request["firewall_policy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_firewall_policy_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_firewall_policy({ parent: parent, firewall_policy: firewall_policy }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_firewall_policy parent: parent, firewall_policy: firewall_policy do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new(parent: parent, firewall_policy: firewall_policy) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_firewall_policy({ parent: parent, firewall_policy: firewall_policy }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest.new(parent: parent, firewall_policy: firewall_policy), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_firewall_policy_client_stub.call_rpc_count - end - end - - def test_list_firewall_policies - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_firewall_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_firewall_policies, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, 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_firewall_policies_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_firewall_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_firewall_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_firewall_policies ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.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_firewall_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_firewall_policies(::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest.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_firewall_policies_client_stub.call_rpc_count - end - end - - def test_get_firewall_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_firewall_policy, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_firewall_policy_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_firewall_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_firewall_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_firewall_policy({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_firewall_policy_client_stub.call_rpc_count - end - end - - def test_update_firewall_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - firewall_policy = {} - update_mask = {} - - update_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_firewall_policy, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy), request["firewall_policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_firewall_policy_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_firewall_policy({ firewall_policy: firewall_policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_firewall_policy firewall_policy: firewall_policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new(firewall_policy: firewall_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.update_firewall_policy({ firewall_policy: firewall_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.update_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest.new(firewall_policy: firewall_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, update_firewall_policy_client_stub.call_rpc_count - end - end - - def test_delete_firewall_policy - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_firewall_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_firewall_policy, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_firewall_policy_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_firewall_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_firewall_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_firewall_policy ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_firewall_policy({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_firewall_policy(::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest.new(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_firewall_policy_client_stub.call_rpc_count - end - end - - def test_reorder_firewall_policies - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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"] - - reorder_firewall_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reorder_firewall_policies, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reorder_firewall_policies_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reorder_firewall_policies({ parent: parent, names: names }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.reorder_firewall_policies parent: parent, names: names do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.reorder_firewall_policies ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new(parent: parent, names: names) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.reorder_firewall_policies({ parent: parent, names: names }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.reorder_firewall_policies(::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest.new(parent: parent, names: names), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, reorder_firewall_policies_client_stub.call_rpc_count - end - end - - def test_list_related_account_groups - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_related_account_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_related_account_groups, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, 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_related_account_groups_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_related_account_groups({ parent: parent, page_size: page_size, page_token: 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_related_account_groups parent: parent, page_size: page_size, page_token: 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_related_account_groups ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.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_related_account_groups({ 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_related_account_groups(::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.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_related_account_groups_client_stub.call_rpc_count - end - end - - def test_list_related_account_group_memberships - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_related_account_group_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_related_account_group_memberships, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest, 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_related_account_group_memberships_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_related_account_group_memberships({ parent: parent, page_size: page_size, page_token: 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_related_account_group_memberships parent: parent, page_size: page_size, page_token: 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_related_account_group_memberships ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.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_related_account_group_memberships({ 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_related_account_group_memberships(::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.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_related_account_group_memberships_client_stub.call_rpc_count - end - end - - def test_search_related_account_group_memberships - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - account_id = "hello world" - hashed_account_id = "hello world" - page_size = 42 - page_token = "hello world" - - search_related_account_group_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_related_account_group_memberships, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest, request - assert_equal "hello world", request["project"] - assert_equal "hello world", request["account_id"] - assert_equal "hello world", request["hashed_account_id"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_related_account_group_memberships_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_related_account_group_memberships({ project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_related_account_group_memberships project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_related_account_group_memberships ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new(project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_related_account_group_memberships({ project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_related_account_group_memberships(::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new(project: project, account_id: account_id, hashed_account_id: hashed_account_id, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_related_account_group_memberships_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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json deleted file mode 100644 index f893403d339d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "api_id": "recaptchaenterprise.googleapis.com", - "api_shortname": "recaptchaenterprise", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1beta1/latest", - "distribution_name": "google-cloud-recaptcha_enterprise-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "recaptchaenterprise", - "name_pretty": "reCAPTCHA Enterprise V1beta1 API", - "product_documentation": "https://cloud.google.com/recaptcha-enterprise", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", - "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", - "ruby-cloud-service-override": "RecaptchaEnterpriseServiceV1Beta1=RecaptchaEnterpriseService", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml deleted file mode 100644 index 9a1ea4dffbc4..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts deleted file mode 100644 index 23d0ee7fd22d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="reCAPTCHA Enterprise 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-recaptcha_enterprise-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 70a1f346f468..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" - -client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recaptcha_enterprise/v1beta1" - -::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md deleted file mode 100644 index 05dcd1e387b0..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the reCAPTCHA Enterprise V1beta1 API - -Help protect your website from fraudulent activity, spam, and abuse without creating friction. - -reCAPTCHA Enterprise is a service that protects your site from spam and abuse. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the reCAPTCHA Enterprise V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-recaptcha_enterprise](https://rubygems.org/gems/google-cloud-recaptcha_enterprise). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-recaptcha_enterprise-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/recaptchaenterprise.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/recaptcha_enterprise/v1beta1" - -client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new -request = ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new # (request fields as keyword arguments...) -response = client.create_assessment request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) -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/recaptcha_enterprise/v1beta1" -require "logger" - -client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. -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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/Rakefile deleted file mode 100644 index 20d431ff9810..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" - ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recaptcha_enterprise-v1beta1" - header "google-cloud-recaptcha_enterprise-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recaptcha_enterprise-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json deleted file mode 100644 index 115e99300266..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.recaptchaenterprise.v1beta1", - "libraryPackage": "::Google::Cloud::RecaptchaEnterprise::V1beta1", - "services": { - "RecaptchaEnterpriseServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client", - "rpcs": { - "CreateAssessment": { - "methods": [ - "create_assessment" - ] - }, - "AnnotateAssessment": { - "methods": [ - "annotate_assessment" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec deleted file mode 100644 index 5b7e33e7c000..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/google-cloud-recaptcha_enterprise-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recaptcha_enterprise/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recaptcha_enterprise-v1beta1" - gem.version = Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse. Note that google-cloud-recaptcha_enterprise-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recaptcha_enterprise instead. See the readme for more details." - gem.summary = "Help protect your website from fraudulent activity, spam, and abuse without creating friction." - 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-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-v1beta1.rb deleted file mode 100644 index 6c4253f03b51..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google-cloud-recaptcha_enterprise-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/recaptcha_enterprise/v1beta1" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1.rb deleted file mode 100644 index 80b907a89991..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" -require "google/cloud/recaptcha_enterprise/v1beta1/version" - -module Google - module Cloud - module RecaptchaEnterprise - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/recaptcha_enterprise/v1beta1" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/recaptcha_enterprise/v1beta1" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/recaptcha_enterprise/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service.rb deleted file mode 100644 index a3ad99c59f3a..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/version" - -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - ## - # Service to determine the likelihood an event is legitimate. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - module RecaptchaEnterpriseService - end - end - end - end -end - -helper_path = ::File.join __dir__, "recaptcha_enterprise_service", "helpers.rb" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb deleted file mode 100644 index ef8c94f53ed9..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb +++ /dev/null @@ -1,590 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseService - ## - # Client for the RecaptchaEnterpriseService service. - # - # Service to determine the likelihood an event is legitimate. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recaptcha_enterprise_service_stub - - ## - # Configure the RecaptchaEnterpriseService Client class. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RecaptchaEnterpriseService clients - # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RecaptchaEnterprise", "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.create_assessment.timeout = 600.0 - - default_config.rpcs.annotate_assessment.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RecaptchaEnterpriseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @recaptcha_enterprise_service_stub.universe_domain - end - - ## - # Create a new RecaptchaEnterpriseService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RecaptchaEnterpriseService 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/recaptchaenterprise/v1beta1/recaptchaenterprise_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 - - @recaptcha_enterprise_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseServiceV1Beta1::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 - ) - - @recaptcha_enterprise_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @recaptcha_enterprise_service_stub.logger - end - - # Service calls - - ## - # Creates an Assessment of the likelihood an event is legitimate. - # - # @overload create_assessment(request, options = nil) - # Pass arguments to `create_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_assessment(parent: nil, assessment: nil) - # Pass arguments to `create_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 project in which the assessment is created, - # in the format `projects/{project_number}`. - # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment, ::Hash] - # Required. The assessment details. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new - # - # # Call the create_assessment method. - # result = client.create_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. - # p result - # - def create_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest - - # Converts hash and nil to 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_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_assessment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Annotates a previously created Assessment to provide additional information - # on whether the event turned out to be authentic or fradulent. - # - # @overload annotate_assessment(request, options = nil) - # Pass arguments to `annotate_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) - # Pass arguments to `annotate_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Assessment, in the format - # `projects/{project_number}/assessments/{assessment_id}`. - # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] - # Optional. The annotation that is assigned to the Event. This field can be - # left empty to provide reasons that apply to an event without concluding - # whether the event is legitimate or fraudulent. - # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] - # Optional. Reasons for the annotation that are assigned to the event. - # @param hashed_account_id [::String] - # Optional. Unique stable hashed user identifier to apply to the assessment. - # This is an alternative to setting the `hashed_account_id` in - # `CreateAssessment`, for example, when the account identifier is not yet - # known in the initial request. It is recommended that the identifier is - # hashed using hmac-sha256 with stable secret. - # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash] - # Optional. If the assessment is part of a payment transaction, provide - # details on payment lifecycle events that occur in the transaction. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new - # - # # Call the annotate_assessment method. - # result = client.annotate_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. - # p result - # - def annotate_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.annotate_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.annotate_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, 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 RecaptchaEnterpriseService API. - # - # This class represents the configuration for RecaptchaEnterpriseService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_assessment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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 = "recaptchaenterprise.googleapis.com" - - config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_assessment - ## - # RPC-specific configuration for `annotate_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :annotate_assessment - - # @private - def initialize parent_rpcs = nil - create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment - @create_assessment = ::Gapic::Config::Method.new create_assessment_config - annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment - @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials.rb deleted file mode 100644 index 484ac47237b5..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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 RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseService - # Credentials for the RecaptchaEnterpriseService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECAPTCHA_ENTERPRISE_CREDENTIALS", - "RECAPTCHA_ENTERPRISE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECAPTCHA_ENTERPRISE_CREDENTIALS_JSON", - "RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths.rb deleted file mode 100644 index b55591922ef0..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/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 RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseService - # Path helper methods for the RecaptchaEnterpriseService API. - module Paths - ## - # Create a fully-qualified Assessment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/assessments/{assessment}` - # - # @param project [String] - # @param assessment [String] - # - # @return [::String] - def assessment_path project:, assessment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/assessments/#{assessment}" - 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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest.rb deleted file mode 100644 index 2f14ab8e40be..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/version" - -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/credentials" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/paths" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client" - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - ## - # Service to determine the likelihood an event is legitimate. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - module RecaptchaEnterpriseService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb deleted file mode 100644 index b63a63711ac1..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/client.rb +++ /dev/null @@ -1,533 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub" - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseService - module Rest - ## - # REST client for the RecaptchaEnterpriseService service. - # - # Service to determine the likelihood an event is legitimate. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recaptchaenterprise.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recaptcha_enterprise_service_stub - - ## - # Configure the RecaptchaEnterpriseService Client class. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RecaptchaEnterpriseService clients - # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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", "RecaptchaEnterprise", "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.create_assessment.timeout = 600.0 - - default_config.rpcs.annotate_assessment.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RecaptchaEnterpriseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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 - @recaptcha_enterprise_service_stub.universe_domain - end - - ## - # Create a new RecaptchaEnterpriseService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RecaptchaEnterpriseService 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 - - @recaptcha_enterprise_service_stub = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @recaptcha_enterprise_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @recaptcha_enterprise_service_stub.logger - end - - # Service calls - - ## - # Creates an Assessment of the likelihood an event is legitimate. - # - # @overload create_assessment(request, options = nil) - # Pass arguments to `create_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_assessment(parent: nil, assessment: nil) - # Pass arguments to `create_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 project in which the assessment is created, - # in the format `projects/{project_number}`. - # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment, ::Hash] - # Required. The assessment details. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new - # - # # Call the create_assessment method. - # result = client.create_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. - # p result - # - def create_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest - - # Converts hash and nil to an 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_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_assessment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.create_assessment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Annotates a previously created Assessment to provide additional information - # on whether the event turned out to be authentic or fradulent. - # - # @overload annotate_assessment(request, options = nil) - # Pass arguments to `annotate_assessment` via a request object, either of type - # {::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) - # Pass arguments to `annotate_assessment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Assessment, in the format - # `projects/{project_number}/assessments/{assessment_id}`. - # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] - # Optional. The annotation that is assigned to the Event. This field can be - # left empty to provide reasons that apply to an event without concluding - # whether the event is legitimate or fraudulent. - # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] - # Optional. Reasons for the annotation that are assigned to the event. - # @param hashed_account_id [::String] - # Optional. Unique stable hashed user identifier to apply to the assessment. - # This is an alternative to setting the `hashed_account_id` in - # `CreateAssessment`, for example, when the account identifier is not yet - # known in the initial request. It is recommended that the identifier is - # hashed using hmac-sha256 with stable secret. - # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash] - # Optional. If the assessment is part of a payment transaction, provide - # details on payment lifecycle events that occur in the transaction. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recaptcha_enterprise/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new - # - # # Call the annotate_assessment method. - # result = client.annotate_assessment request - # - # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. - # p result - # - def annotate_assessment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.annotate_assessment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.annotate_assessment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recaptcha_enterprise_service_stub.annotate_assessment request, 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 RecaptchaEnterpriseService REST API. - # - # This class represents the configuration for RecaptchaEnterpriseService 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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_assessment.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "recaptchaenterprise.googleapis.com" - - config_attr :endpoint, nil, ::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 RecaptchaEnterpriseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_assessment - ## - # RPC-specific configuration for `annotate_assessment` - # @return [::Gapic::Config::Method] - # - attr_reader :annotate_assessment - - # @private - def initialize parent_rpcs = nil - create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment - @create_assessment = ::Gapic::Config::Method.new create_assessment_config - annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment - @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb deleted file mode 100644 index 2a95d5352a94..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseService - module Rest - ## - # REST service stub for the RecaptchaEnterpriseService 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_assessment REST call - # - # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # A result object deserialized from the server's reply - def create_assessment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_assessment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_assessment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the annotate_assessment REST call - # - # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse] - # A result object deserialized from the server's reply - def annotate_assessment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_annotate_assessment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "annotate_assessment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.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_assessment REST call - # - # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest] - # 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_assessment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/assessments", - body: "assessment", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the annotate_assessment REST call - # - # @param request_pb [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_annotate_assessment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:annotate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/assessments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/rest.rb deleted file mode 100644 index db8e11adc626..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" -require "google/cloud/recaptcha_enterprise/v1beta1/version" - -module Google - module Cloud - module RecaptchaEnterprise - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/recaptcha_enterprise/v1beta1/rest" - # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb deleted file mode 100644 index ca24b6a6324d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb deleted file mode 100644 index dd66122e26fc..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.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/protobuf/timestamp_pb' - - -descriptor_data = "\nBgoogle/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto\x12(google.cloud.recaptchaenterprise.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xad\x01\n\x17\x43reateAssessmentRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12M\n\nassessment\x18\x02 \x01(\x0b\x32\x34.google.cloud.recaptchaenterprise.v1beta1.AssessmentB\x03\xe0\x41\x02\"\x97\x05\n\x10TransactionEvent\x12h\n\nevent_type\x18\x01 \x01(\x0e\x32O.google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventTypeB\x03\xe0\x41\x01\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xba\x03\n\x14TransactionEventType\x12&\n\"TRANSACTION_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10MERCHANT_APPROVE\x10\x01\x12\x11\n\rMERCHANT_DENY\x10\x02\x12\x11\n\rMANUAL_REVIEW\x10\x03\x12\x11\n\rAUTHORIZATION\x10\x04\x12\x19\n\x15\x41UTHORIZATION_DECLINE\x10\x05\x12\x13\n\x0fPAYMENT_CAPTURE\x10\x06\x12\x1b\n\x17PAYMENT_CAPTURE_DECLINE\x10\x07\x12\n\n\x06\x43\x41NCEL\x10\x08\x12\x16\n\x12\x43HARGEBACK_INQUIRY\x10\t\x12\x14\n\x10\x43HARGEBACK_ALERT\x10\n\x12\x16\n\x12\x46RAUD_NOTIFICATION\x10\x0b\x12\x0e\n\nCHARGEBACK\x10\x0c\x12\x1c\n\x18\x43HARGEBACK_REPRESENTMENT\x10\r\x12\x16\n\x12\x43HARGEBACK_REVERSE\x10\x0e\x12\x12\n\x0eREFUND_REQUEST\x10\x0f\x12\x12\n\x0eREFUND_DECLINE\x10\x10\x12\n\n\x06REFUND\x10\x11\x12\x12\n\x0eREFUND_REVERSE\x10\x12\"\xf9\x06\n\x19\x41nnotateAssessmentRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recaptchaenterprise.googleapis.com/Assessment\x12g\n\nannotation\x18\x02 \x01(\x0e\x32N.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.AnnotationB\x03\xe0\x41\x01\x12`\n\x07reasons\x18\x03 \x03(\x0e\x32J.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.ReasonB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x04 \x01(\x0c\x42\x03\xe0\x41\x01\x12Z\n\x11transaction_event\x18\x05 \x01(\x0b\x32:.google.cloud.recaptchaenterprise.v1beta1.TransactionEventB\x03\xe0\x41\x01\"~\n\nAnnotation\x12\x1a\n\x16\x41NNOTATION_UNSPECIFIED\x10\x00\x12\x0e\n\nLEGITIMATE\x10\x01\x12\x0e\n\nFRAUDULENT\x10\x02\x12\x18\n\x10PASSWORD_CORRECT\x10\x03\x1a\x02\x08\x01\x12\x1a\n\x12PASSWORD_INCORRECT\x10\x04\x1a\x02\x08\x01\"\xcf\x02\n\x06Reason\x12\x16\n\x12REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nCHARGEBACK\x10\x01\x12\x14\n\x10\x43HARGEBACK_FRAUD\x10\x08\x12\x16\n\x12\x43HARGEBACK_DISPUTE\x10\t\x12\n\n\x06REFUND\x10\n\x12\x10\n\x0cREFUND_FRAUD\x10\x0b\x12\x18\n\x14TRANSACTION_ACCEPTED\x10\x0c\x12\x18\n\x14TRANSACTION_DECLINED\x10\r\x12\x16\n\x12PAYMENT_HEURISTICS\x10\x02\x12\x18\n\x14INITIATED_TWO_FACTOR\x10\x07\x12\x15\n\x11PASSED_TWO_FACTOR\x10\x03\x12\x15\n\x11\x46\x41ILED_TWO_FACTOR\x10\x04\x12\x14\n\x10\x43ORRECT_PASSWORD\x10\x05\x12\x16\n\x12INCORRECT_PASSWORD\x10\x06\x12\x0f\n\x0bSOCIAL_SPAM\x10\x0e\"\x1c\n\x1a\x41nnotateAssessmentResponse\"\x86\x01\n\x18PasswordLeakVerification\x12$\n\x17hashed_user_credentials\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x63redentials_leaked\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12#\n\x16\x63\x61nonicalized_username\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb7\x07\n\nAssessment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12>\n\x05\x65vent\x18\x02 \x01(\x0b\x32/.google.cloud.recaptchaenterprise.v1beta1.Event\x12\x12\n\x05score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x03\x12X\n\x10token_properties\x18\x04 \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1beta1.TokenPropertiesB\x03\xe0\x41\x03\x12_\n\x07reasons\x18\x05 \x03(\x0e\x32I.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReasonB\x03\xe0\x41\x03\x12\x66\n\x1apassword_leak_verification\x18\x07 \x01(\x0b\x32\x42.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification\x12h\n\x1b\x61\x63\x63ount_defender_assessment\x18\x08 \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment\x12h\n\x1b\x66raud_prevention_assessment\x18\x0b \x01(\x0b\x32\x43.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment\"\xe9\x01\n\x14\x43lassificationReason\x12%\n!CLASSIFICATION_REASON_UNSPECIFIED\x10\x00\x12\x0e\n\nAUTOMATION\x10\x01\x12\x1a\n\x16UNEXPECTED_ENVIRONMENT\x10\x02\x12\x14\n\x10TOO_MUCH_TRAFFIC\x10\x03\x12\x1d\n\x19UNEXPECTED_USAGE_PATTERNS\x10\x04\x12\x18\n\x14LOW_CONFIDENCE_SCORE\x10\x05\x12\x15\n\x11SUSPECTED_CARDING\x10\x06\x12\x18\n\x14SUSPECTED_CHARGEBACK\x10\x07:_\xea\x41\\\n-recaptchaenterprise.googleapis.com/Assessment\x12+projects/{project}/assessments/{assessment}\"\xb1\x03\n\x05\x45vent\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08site_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fuser_ip_address\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x65xpected_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11hashed_account_id\x18\x06 \x01(\x0c\x42\x03\xe0\x41\x01\x12X\n\x10transaction_data\x18\r \x01(\x0b\x32\x39.google.cloud.recaptchaenterprise.v1beta1.TransactionDataB\x03\xe0\x41\x01\x12^\n\x10\x66raud_prevention\x18\x11 \x01(\x0e\x32?.google.cloud.recaptchaenterprise.v1beta1.Event.FraudPreventionB\x03\xe0\x41\x01\"N\n\x0f\x46raudPrevention\x12 \n\x1c\x46RAUD_PREVENTION_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\x9d\t\n\x0fTransactionData\x12\x1b\n\x0etransaction_id\x18\x0b \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0epayment_method\x18\x01 \x01(\t\x12\x10\n\x08\x63\x61rd_bin\x18\x02 \x01(\t\x12\x16\n\x0e\x63\x61rd_last_four\x18\x03 \x01(\t\x12\x15\n\rcurrency_code\x18\x04 \x01(\t\x12\r\n\x05value\x18\x05 \x01(\x01\x12\x16\n\x0eshipping_value\x18\x0c \x01(\x01\x12[\n\x10shipping_address\x18\x06 \x01(\x0b\x32\x41.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address\x12Z\n\x0f\x62illing_address\x18\x07 \x01(\x0b\x32\x41.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address\x12L\n\x04user\x18\x08 \x01(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User\x12Q\n\tmerchants\x18\r \x03(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.User\x12M\n\x05items\x18\x0e \x03(\x0b\x32>.google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item\x12[\n\x0cgateway_info\x18\n \x01(\x0b\x32\x45.google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo\x1a\x86\x01\n\x07\x41\x64\x64ress\x12\x11\n\trecipient\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x03(\t\x12\x10\n\x08locality\x18\x03 \x01(\t\x12\x1b\n\x13\x61\x64ministrative_area\x18\x04 \x01(\t\x12\x13\n\x0bregion_code\x18\x05 \x01(\t\x12\x13\n\x0bpostal_code\x18\x06 \x01(\t\x1a\x84\x01\n\x04User\x12\x12\n\naccount_id\x18\x06 \x01(\t\x12\x13\n\x0b\x63reation_ms\x18\x01 \x01(\x03\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\x16\n\x0e\x65mail_verified\x18\x03 \x01(\x08\x12\x14\n\x0cphone_number\x18\x04 \x01(\t\x12\x16\n\x0ephone_verified\x18\x05 \x01(\x08\x1aR\n\x04Item\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x10\n\x08quantity\x18\x03 \x01(\x03\x12\x1b\n\x13merchant_account_id\x18\x04 \x01(\t\x1ap\n\x0bGatewayInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1d\n\x15gateway_response_code\x18\x02 \x01(\t\x12\x19\n\x11\x61vs_response_code\x18\x03 \x01(\t\x12\x19\n\x11\x63vv_response_code\x18\x04 \x01(\tB\x11\n\x0f_transaction_id\"\xff\x02\n\x0fTokenProperties\x12\r\n\x05valid\x18\x01 \x01(\x08\x12_\n\x0einvalid_reason\x18\x02 \x01(\x0e\x32G.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08hostname\x18\x04 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x05 \x01(\t\"\xa8\x01\n\rInvalidReason\x12\x1e\n\x1aINVALID_REASON_UNSPECIFIED\x10\x00\x12\x1a\n\x16UNKNOWN_INVALID_REASON\x10\x01\x12\r\n\tMALFORMED\x10\x02\x12\x0b\n\x07\x45XPIRED\x10\x03\x12\x08\n\x04\x44UPE\x10\x04\x12\x15\n\rSITE_MISMATCH\x10\x05\x1a\x02\x08\x01\x12\x0b\n\x07MISSING\x10\x06\x12\x11\n\rBROWSER_ERROR\x10\x07\"\xc4\x04\n\x19\x46raudPreventionAssessment\x12\x1d\n\x10transaction_risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x12\x83\x01\n\x19stolen_instrument_verdict\x18\x02 \x01(\x0b\x32[.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdictB\x03\xe0\x41\x03\x12y\n\x14\x63\x61rd_testing_verdict\x18\x03 \x01(\x0b\x32V.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdictB\x03\xe0\x41\x03\x12\x81\x01\n\x18\x62\x65havioral_trust_verdict\x18\x04 \x01(\x0b\x32Z.google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.BehavioralTrustVerdictB\x03\xe0\x41\x03\x1a,\n\x17StolenInstrumentVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a\'\n\x12\x43\x61rdTestingVerdict\x12\x11\n\x04risk\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\x1a,\n\x16\x42\x65havioralTrustVerdict\x12\x12\n\x05trust\x18\x01 \x01(\x02\x42\x03\xe0\x41\x03\"\xbb\x02\n\x19\x41\x63\x63ountDefenderAssessment\x12h\n\x06labels\x18\x01 \x03(\x0e\x32X.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel\"\xb3\x01\n\x14\x41\x63\x63ountDefenderLabel\x12&\n\"ACCOUNT_DEFENDER_LABEL_UNSPECIFIED\x10\x00\x12\x11\n\rPROFILE_MATCH\x10\x01\x12\x1d\n\x19SUSPICIOUS_LOGIN_ACTIVITY\x10\x02\x12\x1f\n\x1bSUSPICIOUS_ACCOUNT_CREATION\x10\x03\x12 \n\x1cRELATED_ACCOUNTS_NUMBER_HIGH\x10\x04\x32\xcd\x04\n!RecaptchaEnterpriseServiceV1Beta1\x12\xdd\x01\n\x10\x43reateAssessment\x12\x41.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest\x1a\x34.google.cloud.recaptchaenterprise.v1beta1.Assessment\"P\xda\x41\x11parent,assessment\x82\xd3\xe4\x93\x02\x36\"(/v1beta1/{parent=projects/*}/assessments:\nassessment\x12\xef\x01\n\x12\x41nnotateAssessment\x12\x43.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest\x1a\x44.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse\"N\xda\x41\x0fname,annotation\x82\xd3\xe4\x93\x02\x36\"1/v1beta1/{name=projects/*/assessments/*}:annotate:\x01*\x1aV\xca\x41\"recaptchaenterprise.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb2\x02\n&com.google.recaptchaenterprise.v1beta1B\x18RecaptchaEnterpriseProtoP\x01Zacloud.google.com/go/recaptchaenterprise/v2/apiv1beta1/recaptchaenterprisepb;recaptchaenterprisepb\xa2\x02\x04GCRE\xaa\x02(Google.Cloud.RecaptchaEnterprise.V1Beta1\xca\x02(Google\\Cloud\\RecaptchaEnterprise\\V1beta1\xea\x02+Google::Cloud::RecaptchaEnterprise::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 RecaptchaEnterprise - module V1beta1 - CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest").msgclass - TransactionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionEvent").msgclass - TransactionEvent::TransactionEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionEvent.TransactionEventType").enummodule - AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest").msgclass - AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation").enummodule - AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason").enummodule - AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse").msgclass - PasswordLeakVerification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification").msgclass - Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment").msgclass - Assessment::ClassificationReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason").enummodule - Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Event").msgclass - Event::FraudPrevention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.Event.FraudPrevention").enummodule - TransactionData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData").msgclass - TransactionData::Address = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.Address").msgclass - TransactionData::User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.User").msgclass - TransactionData::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.Item").msgclass - TransactionData::GatewayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TransactionData.GatewayInfo").msgclass - TokenProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties").msgclass - TokenProperties::InvalidReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason").enummodule - FraudPreventionAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment").msgclass - FraudPreventionAssessment::StolenInstrumentVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.StolenInstrumentVerdict").msgclass - FraudPreventionAssessment::CardTestingVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.CardTestingVerdict").msgclass - FraudPreventionAssessment::BehavioralTrustVerdict = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.FraudPreventionAssessment.BehavioralTrustVerdict").msgclass - AccountDefenderAssessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment").msgclass - AccountDefenderAssessment::AccountDefenderLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb deleted file mode 100644 index 2eafeab096fd..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto for package 'Google.Cloud.RecaptchaEnterprise.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/recaptchaenterprise/v1beta1/recaptchaenterprise_pb' - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - module RecaptchaEnterpriseServiceV1Beta1 - # Service to determine the likelihood an event is legitimate. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' - - # Creates an Assessment of the likelihood an event is legitimate. - rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment - # Annotates a previously created Assessment to provide additional information - # on whether the event turned out to be authentic or fradulent. - rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md deleted file mode 100644 index 55d54bc6f275..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# reCAPTCHA Enterprise 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-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb deleted file mode 100644 index 2849e835788e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb +++ /dev/null @@ -1,711 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecaptchaEnterprise - module V1beta1 - # The create assessment request message. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which the assessment is created, - # in the format `projects/{project_number}`. - # @!attribute [rw] assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment] - # Required. The assessment details. - class CreateAssessmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes an event in the lifecycle of a payment transaction. - # @!attribute [rw] event_type - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent::TransactionEventType] - # Optional. The type of this transaction event. - # @!attribute [rw] reason - # @return [::String] - # Optional. The reason or standardized code that corresponds with this - # transaction event, if one exists. For example, a CHARGEBACK event with code - # 6005. - # @!attribute [rw] value - # @return [::Float] - # Optional. The value that corresponds with this transaction event, if one - # exists. For example, a refund event where $5.00 was refunded. Currency is - # obtained from the original transaction data. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when this transaction event occurred; otherwise assumed - # to be the time of the API call. - class TransactionEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents an event in the payment transaction lifecycle. - module TransactionEventType - # Default, unspecified event type. - TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0 - - # Indicates that the transaction is approved by the merchant. The - # accompanying reasons can include terms such as 'INHOUSE', 'ACCERTIFY', - # 'CYBERSOURCE', or 'MANUAL_REVIEW'. - MERCHANT_APPROVE = 1 - - # Indicates that the transaction is denied and concluded due to risks - # detected by the merchant. The accompanying reasons can include terms such - # as 'INHOUSE', 'ACCERTIFY', 'CYBERSOURCE', or 'MANUAL_REVIEW'. - MERCHANT_DENY = 2 - - # Indicates that the transaction is being evaluated by a human, due to - # suspicion or risk. - MANUAL_REVIEW = 3 - - # Indicates that the authorization attempt with the card issuer succeeded. - AUTHORIZATION = 4 - - # Indicates that the authorization attempt with the card issuer failed. - # The accompanying reasons can include Visa's '54' indicating that the card - # is expired, or '82' indicating that the CVV is incorrect. - AUTHORIZATION_DECLINE = 5 - - # Indicates that the transaction is completed because the funds were - # settled. - PAYMENT_CAPTURE = 6 - - # Indicates that the transaction could not be completed because the funds - # were not settled. - PAYMENT_CAPTURE_DECLINE = 7 - - # Indicates that the transaction has been canceled. Specify the reason - # for the cancellation. For example, 'INSUFFICIENT_INVENTORY'. - CANCEL = 8 - - # Indicates that the merchant has received a chargeback inquiry due to - # fraud for the transaction, requesting additional information before a - # fraud chargeback is officially issued and a formal chargeback - # notification is sent. - CHARGEBACK_INQUIRY = 9 - - # Indicates that the merchant has received a chargeback alert due to fraud - # for the transaction. The process of resolving the dispute without - # involving the payment network is started. - CHARGEBACK_ALERT = 10 - - # Indicates that a fraud notification is issued for the transaction, sent - # by the payment instrument's issuing bank because the transaction appears - # to be fraudulent. We recommend including TC40 or SAFE data in the - # `reason` field for this event type. For partial chargebacks, we recommend - # that you include an amount in the `value` field. - FRAUD_NOTIFICATION = 11 - - # Indicates that the merchant is informed by the payment network that the - # transaction has entered the chargeback process due to fraud. Reason code - # examples include Discover's '6005' and '6041'. For partial chargebacks, - # we recommend that you include an amount in the `value` field. - CHARGEBACK = 12 - - # Indicates that the transaction has entered the chargeback process due to - # fraud, and that the merchant has chosen to enter representment. Reason - # examples include Discover's '6005' and '6041'. For partial chargebacks, - # we recommend that you include an amount in the `value` field. - CHARGEBACK_REPRESENTMENT = 13 - - # Indicates that the transaction has had a fraud chargeback which was - # illegitimate and was reversed as a result. For partial chargebacks, we - # recommend that you include an amount in the `value` field. - CHARGEBACK_REVERSE = 14 - - # Indicates that the merchant has received a refund for a completed - # transaction. For partial refunds, we recommend that you include an amount - # in the `value` field. Reason example: 'TAX_EXEMPT' (partial refund of - # exempt tax) - REFUND_REQUEST = 15 - - # Indicates that the merchant has received a refund request for this - # transaction, but that they have declined it. For partial refunds, we - # recommend that you include an amount in the `value` field. Reason - # example: 'TAX_EXEMPT' (partial refund of exempt tax) - REFUND_DECLINE = 16 - - # Indicates that the completed transaction was refunded by the merchant. - # For partial refunds, we recommend that you include an amount in the - # `value` field. Reason example: 'TAX_EXEMPT' (partial refund of exempt - # tax) - REFUND = 17 - - # Indicates that the completed transaction was refunded by the merchant, - # and that this refund was reversed. For partial refunds, we recommend that - # you include an amount in the `value` field. - REFUND_REVERSE = 18 - end - end - - # The request message to annotate an Assessment. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Assessment, in the format - # `projects/{project_number}/assessments/{assessment_id}`. - # @!attribute [rw] annotation - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation] - # Optional. The annotation that is assigned to the Event. This field can be - # left empty to provide reasons that apply to an event without concluding - # whether the event is legitimate or fraudulent. - # @!attribute [rw] reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>] - # Optional. Reasons for the annotation that are assigned to the event. - # @!attribute [rw] hashed_account_id - # @return [::String] - # Optional. Unique stable hashed user identifier to apply to the assessment. - # This is an alternative to setting the `hashed_account_id` in - # `CreateAssessment`, for example, when the account identifier is not yet - # known in the initial request. It is recommended that the identifier is - # hashed using hmac-sha256 with stable secret. - # @!attribute [rw] transaction_event - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent] - # Optional. If the assessment is part of a payment transaction, provide - # details on payment lifecycle events that occur in the transaction. - class AnnotateAssessmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the types of annotations. - module Annotation - # Default unspecified type. - ANNOTATION_UNSPECIFIED = 0 - - # Provides information that the event turned out to be legitimate. - LEGITIMATE = 1 - - # Provides information that the event turned out to be fraudulent. - FRAUDULENT = 2 - - # Provides information that the event was related to a login event in which - # the user typed the correct password. Deprecated, prefer indicating - # CORRECT_PASSWORD through the reasons field instead. - PASSWORD_CORRECT = 3 - - # Provides information that the event was related to a login event in which - # the user typed the incorrect password. Deprecated, prefer indicating - # INCORRECT_PASSWORD through the reasons field instead. - PASSWORD_INCORRECT = 4 - end - - # Enum that represents potential reasons for annotating an assessment. - module Reason - # Default unspecified reason. - REASON_UNSPECIFIED = 0 - - # Indicates that the transaction had a chargeback issued with no other - # details. When possible, specify the type by using CHARGEBACK_FRAUD or - # CHARGEBACK_DISPUTE instead. - CHARGEBACK = 1 - - # Indicates that the transaction had a chargeback issued related to an - # alleged unauthorized transaction from the cardholder's perspective (for - # example, the card number was stolen). - CHARGEBACK_FRAUD = 8 - - # Indicates that the transaction had a chargeback issued related to the - # cardholder having provided their card details but allegedly not being - # satisfied with the purchase (for example, misrepresentation, attempted - # cancellation). - CHARGEBACK_DISPUTE = 9 - - # Indicates that the completed payment transaction was refunded by the - # seller. - REFUND = 10 - - # Indicates that the completed payment transaction was determined to be - # fraudulent by the seller, and was cancelled and refunded as a result. - REFUND_FRAUD = 11 - - # Indicates that the payment transaction was accepted, and the user was - # charged. - TRANSACTION_ACCEPTED = 12 - - # Indicates that the payment transaction was declined, for example due to - # invalid card details. - TRANSACTION_DECLINED = 13 - - # Indicates the transaction associated with the assessment is suspected of - # being fraudulent based on the payment method, billing details, shipping - # address or other transaction information. - PAYMENT_HEURISTICS = 2 - - # Indicates that the user was served a 2FA challenge. An old assessment - # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been - # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. - # This is equivalent to `FAILED_TWO_FACTOR`. - INITIATED_TWO_FACTOR = 7 - - # Indicates that the user passed a 2FA challenge. - PASSED_TWO_FACTOR = 3 - - # Indicates that the user failed a 2FA challenge. - FAILED_TWO_FACTOR = 4 - - # Indicates the user provided the correct password. - CORRECT_PASSWORD = 5 - - # Indicates the user provided an incorrect password. - INCORRECT_PASSWORD = 6 - - # Indicates that the user sent unwanted and abusive messages to other users - # of the platform, such as spam, scams, phishing, or social engineering. - SOCIAL_SPAM = 14 - end - end - - # Empty response for AnnotateAssessment. - class AnnotateAssessmentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Password leak verification info. - # @!attribute [rw] hashed_user_credentials - # @return [::String] - # Optional. Scrypt hash of the username+password that the customer wants to - # verify against a known password leak. - # @!attribute [r] credentials_leaked - # @return [::Boolean] - # Output only. Whether or not the user's credentials are present in a known - # leak. - # @!attribute [rw] canonicalized_username - # @return [::String] - # Optional. The username part of the user credentials for which we want to - # trigger a leak check in canonicalized form. This is the same data used to - # create the hashed_user_credentials on the customer side. - class PasswordLeakVerification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reCAPTCHA Enterprise assessment resource. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name for the Assessment in the format - # `projects/{project_number}/assessments/{assessment_id}`. - # @!attribute [rw] event - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Event] - # The event being assessed. - # @!attribute [r] score - # @return [::Float] - # Output only. Legitimate event score from 0.0 to 1.0. - # (1.0 means very likely legitimate traffic while 0.0 means very likely - # non-legitimate traffic). - # @!attribute [r] token_properties - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties] - # Output only. Properties of the provided event token. - # @!attribute [r] reasons - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment::ClassificationReason>] - # Output only. Reasons contributing to the risk analysis verdict. - # @!attribute [rw] password_leak_verification - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::PasswordLeakVerification] - # Information about the user's credentials used to check for leaks. - # This feature is part of the Early Access Program (EAP). Exercise caution, - # and do not deploy integrations based on this feature in a production - # environment. - # @!attribute [rw] account_defender_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment] - # Assessment returned by account defender when a hashed_account_id is - # provided. - # @!attribute [rw] fraud_prevention_assessment - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment] - # Assessment returned by Fraud Prevention when TransactionData is provided. - class Assessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reasons contributing to the risk analysis verdict. - module ClassificationReason - # Default unspecified type. - CLASSIFICATION_REASON_UNSPECIFIED = 0 - - # Interactions matched the behavior of an automated agent. - AUTOMATION = 1 - - # The event originated from an illegitimate environment. - UNEXPECTED_ENVIRONMENT = 2 - - # Traffic volume from the event source is higher than normal. - TOO_MUCH_TRAFFIC = 3 - - # Interactions with the site were significantly different than expected - # patterns. - UNEXPECTED_USAGE_PATTERNS = 4 - - # Too little traffic has been received from this site thus far to generate - # quality risk analysis. - LOW_CONFIDENCE_SCORE = 5 - - # The request matches behavioral characteristics of a carding attack. - SUSPECTED_CARDING = 6 - - # The request matches behavioral characteristics of chargebacks for fraud. - SUSPECTED_CHARGEBACK = 7 - end - end - - # @!attribute [rw] token - # @return [::String] - # Optional. The user response token provided by the reCAPTCHA client-side - # integration on your site. - # @!attribute [rw] site_key - # @return [::String] - # Optional. The site key that was used to invoke reCAPTCHA on your site and - # generate the token. - # @!attribute [rw] user_agent - # @return [::String] - # Optional. The user agent present in the request from the user's device - # related to this event. - # @!attribute [rw] user_ip_address - # @return [::String] - # Optional. The IP address in the request from the user's device related to - # this event. - # @!attribute [rw] expected_action - # @return [::String] - # Optional. The expected action for this type of event. This should be the - # same action provided at token generation time on client-side platforms - # already integrated with reCAPTCHA. - # @!attribute [rw] hashed_account_id - # @return [::String] - # Optional. Unique stable hashed user identifier for the request. The - # identifier must be hashed using hmac-sha256 with stable secret. - # @!attribute [rw] transaction_data - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData] - # Optional. Data describing a payment transaction to be assessed. Sending - # this data enables reCAPTCHA Fraud Prevention and the - # FraudPreventionAssessment component in the response. - # @!attribute [rw] fraud_prevention - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Event::FraudPrevention] - # Optional. The Fraud Prevention setting for this Assessment. - class Event - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Setting that controls Fraud Prevention assessments. - module FraudPrevention - # Default, unspecified setting. `fraud_prevention_assessment` is returned - # if `transaction_data` is present in `Event` and Fraud Prevention is - # enabled in the Google Cloud console. - FRAUD_PREVENTION_UNSPECIFIED = 0 - - # Enable Fraud Prevention for this assessment, if Fraud Prevention is - # enabled in the Google Cloud console. - ENABLED = 1 - - # Disable Fraud Prevention for this assessment, regardless of the Google - # Cloud console settings. - DISABLED = 2 - end - end - - # Transaction data associated with a payment protected by reCAPTCHA. - # @!attribute [rw] transaction_id - # @return [::String] - # Unique identifier for the transaction. This custom identifier can be used - # to reference this transaction in the future, for example, labeling a refund - # or chargeback event. Two attempts at the same transaction should use the - # same transaction id. - # @!attribute [rw] payment_method - # @return [::String] - # The payment method for the transaction. The allowed values are: - # - # * credit-card - # * debit-card - # * gift-card - # * processor-\\{name} (If a third-party is used, for example, - # processor-paypal) - # * custom-\\{name} (If an alternative method is used, for example, - # custom-crypto) - # @!attribute [rw] card_bin - # @return [::String] - # The Bank Identification Number - generally the first 6 or 8 digits of the - # card. - # @!attribute [rw] card_last_four - # @return [::String] - # The last four digits of the card. - # @!attribute [rw] currency_code - # @return [::String] - # The currency code in ISO-4217 format. - # @!attribute [rw] value - # @return [::Float] - # The decimal value of the transaction in the specified currency. - # @!attribute [rw] shipping_value - # @return [::Float] - # The value of shipping in the specified currency. 0 for free or no shipping. - # @!attribute [rw] shipping_address - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Address] - # Destination address if this transaction involves shipping a physical item. - # @!attribute [rw] billing_address - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Address] - # Address associated with the payment method when applicable. - # @!attribute [rw] user - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::User] - # Information about the user paying/initiating the transaction. - # @!attribute [rw] merchants - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::User>] - # Information about the user or users fulfilling the transaction. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::Item>] - # Items purchased in this transaction. - # @!attribute [rw] gateway_info - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionData::GatewayInfo] - # Information about the payment gateway's response to the transaction. - class TransactionData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Structured address format for billing and shipping addresses. - # @!attribute [rw] recipient - # @return [::String] - # The recipient name, potentially including information such as "care of". - # @!attribute [rw] address - # @return [::Array<::String>] - # The first lines of the address. The first line generally contains the - # street name and number, and further lines may include information such as - # an apartment number. - # @!attribute [rw] locality - # @return [::String] - # The town/city of the address. - # @!attribute [rw] administrative_area - # @return [::String] - # The state, province, or otherwise administrative area of the address. - # @!attribute [rw] region_code - # @return [::String] - # The CLDR country/region of the address. - # @!attribute [rw] postal_code - # @return [::String] - # The postal or ZIP code of the address. - class Address - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about a user's account involved in the transaction. - # @!attribute [rw] account_id - # @return [::String] - # Unique account identifier for this user. If using account defender, - # this should match the hashed_account_id field. Otherwise, a unique and - # persistent identifier for this account. - # @!attribute [rw] creation_ms - # @return [::Integer] - # The epoch milliseconds of the user's account creation. - # @!attribute [rw] email - # @return [::String] - # The email address of the user. - # @!attribute [rw] email_verified - # @return [::Boolean] - # Whether the email has been verified to be accessible by the user (OTP or - # similar). - # @!attribute [rw] phone_number - # @return [::String] - # The phone number of the user, with country code. - # @!attribute [rw] phone_verified - # @return [::Boolean] - # Whether the phone number has been verified to be accessible by the user - # (OTP or similar). - class User - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Line items being purchased in this transaction. - # @!attribute [rw] name - # @return [::String] - # The full name of the item. - # @!attribute [rw] value - # @return [::Float] - # The value per item that the user is paying, in the transaction currency, - # after discounts. - # @!attribute [rw] quantity - # @return [::Integer] - # The quantity of this item that is being purchased. - # @!attribute [rw] merchant_account_id - # @return [::String] - # When a merchant is specified, its corresponding account_id. Necessary to - # populate marketplace-style transactions. - class Item - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about the transaction from the gateway. - # @!attribute [rw] name - # @return [::String] - # Name of the gateway service (for example, stripe, square, paypal). - # @!attribute [rw] gateway_response_code - # @return [::String] - # Gateway response code describing the state of the transaction. - # @!attribute [rw] avs_response_code - # @return [::String] - # AVS response code from the gateway - # (available only when reCAPTCHA is called after authorization). - # @!attribute [rw] cvv_response_code - # @return [::String] - # CVV response code from the gateway - # (available only when reCAPTCHA is called after authorization). - class GatewayInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] valid - # @return [::Boolean] - # Whether the provided user response token is valid. When valid = false, the - # reason could be specified in invalid_reason or it could also be due to - # a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey - # used to generate the token was different than the one specified in the - # assessment). - # @!attribute [rw] invalid_reason - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties::InvalidReason] - # Reason associated with the response when valid = false. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp corresponding to the generation of the token. - # @!attribute [rw] hostname - # @return [::String] - # The hostname of the page on which the token was generated. - # @!attribute [rw] action - # @return [::String] - # Action name provided at token generation. - class TokenProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the types of invalid token reasons. - module InvalidReason - # Default unspecified type. - INVALID_REASON_UNSPECIFIED = 0 - - # If the failure reason was not accounted for. - UNKNOWN_INVALID_REASON = 1 - - # The provided user verification token was malformed. - MALFORMED = 2 - - # The user verification token had expired. - EXPIRED = 3 - - # The user verification had already been seen. - DUPE = 4 - - # The user verification token did not match the provided site key. - # This may be a configuration error (for example, development keys used in - # production) or end users trying to use verification tokens from other - # sites. - SITE_MISMATCH = 5 - - # The user verification token was not present. It is a required input. - MISSING = 6 - - # A retriable error (such as network failure) occurred on the browser. - # Could easily be simulated by an attacker. - BROWSER_ERROR = 7 - end - end - - # Assessment for Fraud Prevention. - # @!attribute [r] transaction_risk - # @return [::Float] - # Output only. Probability (0-1) of this transaction being fraudulent. - # Summarizes the combined risk of attack vectors below. - # @!attribute [r] stolen_instrument_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::StolenInstrumentVerdict] - # Output only. Assessment of this transaction for risk of a stolen - # instrument. - # @!attribute [r] card_testing_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::CardTestingVerdict] - # Output only. Assessment of this transaction for risk of being part of a - # card testing attack. - # @!attribute [r] behavioral_trust_verdict - # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::FraudPreventionAssessment::BehavioralTrustVerdict] - # Output only. Assessment of this transaction for behavioral trust. - class FraudPreventionAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about stolen instrument fraud, where the user is not the - # legitimate owner of the instrument being used for the purchase. - # @!attribute [r] risk - # @return [::Float] - # Output only. Probability (0-1) of this transaction being executed with a - # stolen instrument. - class StolenInstrumentVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about card testing fraud, where an adversary is testing - # fraudulently obtained cards or brute forcing their details. - # @!attribute [r] risk - # @return [::Float] - # Output only. Probability (0-1) of this transaction attempt being part of - # a card testing attack. - class CardTestingVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about behavioral trust of the transaction. - # @!attribute [r] trust - # @return [::Float] - # Output only. Probability (0-1) of this transaction attempt being executed - # in a behaviorally trustworthy way. - class BehavioralTrustVerdict - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Account defender risk assessment. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment::AccountDefenderLabel>] - # Labels for this request. - class AccountDefenderAssessment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Labels returned by account defender for this request. - module AccountDefenderLabel - # Default unspecified type. - ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0 - - # The request matches a known good profile for the user. - PROFILE_MATCH = 1 - - # The request is potentially a suspicious login event and should be further - # verified either via multi-factor authentication or another system. - SUSPICIOUS_LOGIN_ACTIVITY = 2 - - # The request matched a profile that previously had suspicious account - # creation behavior. This could mean this is a fake account. - SUSPICIOUS_ACCOUNT_CREATION = 3 - - # The account in the request has a high number of related accounts. It does - # not necessarily imply that the account is bad but could require - # investigating. - RELATED_ACCOUNTS_NUMBER_HIGH = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile deleted file mode 100644 index cd7e7ac21ad6..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1", path: "../" -else - gem "google-cloud-recaptcha_enterprise-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-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb deleted file mode 100644 index 878df858941e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] -require "google/cloud/recaptcha_enterprise/v1beta1" - -## -# Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment. -# -def annotate_assessment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new - - # Call the annotate_assessment method. - result = client.annotate_assessment request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. - p result -end -# [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb deleted file mode 100644 index aeef99867e72..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] -require "google/cloud/recaptcha_enterprise/v1beta1" - -## -# Snippet for the create_assessment call in the RecaptchaEnterpriseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment. -# -def create_assessment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new - - # Call the create_assessment method. - result = client.create_assessment request - - # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. - p result -end -# [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json deleted file mode 100644 index a9c983822572..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-recaptcha_enterprise-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.recaptchaenterprise.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync", - "title": "Snippet for the create_assessment call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment.", - "file": "recaptcha_enterprise_service/create_assessment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_assessment", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "CreateAssessment", - "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync", - "title": "Snippet for the annotate_assessment call in the RecaptchaEnterpriseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment.", - "file": "recaptcha_enterprise_service/annotate_assessment.rb", - "language": "RUBY", - "client_method": { - "short_name": "annotate_assessment", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse", - "client": { - "short_name": "RecaptchaEnterpriseService::Client", - "full_name": "::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client" - }, - "method": { - "short_name": "AnnotateAssessment", - "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", - "service": { - "short_name": "RecaptchaEnterpriseService", - "full_name": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - }, - "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-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb deleted file mode 100644 index b2865dfb190e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_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/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" - -class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assessment_path project: "value0", assessment: "value1" - assert_equal "projects/value0/assessments/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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb deleted file mode 100644 index 3270a52aa015..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest" - - -class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment - # Create test objects. - client_result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - assessment = {} - - create_assessment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.stub :transcode_create_assessment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_assessment({ parent: parent, assessment: assessment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_assessment parent: parent, assessment: assessment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_assessment({ parent: parent, assessment: assessment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_assessment_client_stub.call_count - end - end - end - - def test_annotate_assessment - # Create test objects. - client_result = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - annotation = :ANNOTATION_UNSPECIFIED - reasons = [:REASON_UNSPECIFIED] - hashed_account_id = "hello world" - transaction_event = {} - - annotate_assessment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.stub :transcode_annotate_assessment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, annotate_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.annotate_assessment name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, annotate_assessment_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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb deleted file mode 100644 index d3a7e7b9a314..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb" -require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" - -class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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_assessment - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - assessment = {} - - create_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_assessment, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment), request["assessment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_assessment({ parent: parent, assessment: assessment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_assessment parent: parent, assessment: assessment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_assessment({ parent: parent, assessment: assessment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new(parent: parent, assessment: assessment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_assessment_client_stub.call_rpc_count - end - end - - def test_annotate_assessment - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - annotation = :ANNOTATION_UNSPECIFIED - reasons = [:REASON_UNSPECIFIED] - hashed_account_id = "hello world" - transaction_event = {} - - annotate_assessment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :annotate_assessment, name - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, request - assert_equal "hello world", request["name"] - assert_equal :ANNOTATION_UNSPECIFIED, request["annotation"] - assert_equal [:REASON_UNSPECIFIED], request["reasons"] - assert_equal "hello world", request["hashed_account_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent), request["transaction_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, annotate_assessment_client_stub do - # Create client - client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.annotate_assessment name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.annotate_assessment ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.annotate_assessment({ name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.annotate_assessment(::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new(name: name, annotation: annotation, reasons: reasons, hashed_account_id: hashed_account_id, transaction_event: transaction_event), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, annotate_assessment_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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise-v1beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise/.gitignore b/owl-bot-staging/google-cloud-recaptcha_enterprise/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/.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-recaptcha_enterprise/.repo-metadata.json b/owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json deleted file mode 100644 index 35ab06056f92..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recaptchaenterprise.googleapis.com", - "api_shortname": "recaptchaenterprise", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise/latest", - "distribution_name": "google-cloud-recaptcha_enterprise", - "is_cloud": true, - "language": "ruby", - "name": "recaptchaenterprise", - "name_pretty": "reCAPTCHA Enterprise API", - "product_documentation": "https://cloud.google.com/recaptcha-enterprise", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "reCAPTCHA Enterprise is a service that protects your site from spam and abuse.", - "ruby-cloud-env-prefix": "RECAPTCHA_ENTERPRISE", - "ruby-cloud-product-url": "https://cloud.google.com/recaptcha-enterprise", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml b/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml deleted file mode 100644 index fcb7a91bebac..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recaptcha_enterprise.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-recaptcha_enterprise.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/.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-recaptcha_enterprise/.yardopts b/owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts deleted file mode 100644 index 3e6ecd16105e..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="reCAPTCHA Enterprise 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-recaptcha_enterprise/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md deleted file mode 100644 index 40c7c6576a97..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recaptcha_enterprise 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-recaptcha_enterprise 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/recaptcha_enterprise" - -client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recaptcha_enterprise" - -Google::Cloud::RecaptchaEnterprise.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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-recaptcha_enterprise -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/recaptcha_enterprise" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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-recaptcha_enterprise/CHANGELOG.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile b/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile deleted file mode 100644 index c2fe33a3fa5c..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-recaptcha_enterprise-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recaptcha_enterprise.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-recaptcha_enterprise/LICENSE.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recaptcha_enterprise/README.md b/owl-bot-staging/google-cloud-recaptcha_enterprise/README.md deleted file mode 100644 index 2d7d2c76e33b..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the reCAPTCHA Enterprise API - -API Client library for the reCAPTCHA Enterprise API - -reCAPTCHA Enterprise is a service that protects your site from spam and abuse. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-recaptcha_enterprise-v*`. -The gem `google-cloud-recaptcha_enterprise` 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-recaptcha_enterprise/latest) -for this library, google-cloud-recaptcha_enterprise, 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-recaptcha_enterprise-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-recaptcha_enterprise -``` - -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/recaptchaenterprise.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/recaptcha_enterprise" - -client = Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service -request = ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new # (request fields as keyword arguments...) -response = client.create_assessment 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-recaptcha_enterprise-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recaptcha_enterprise-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-recaptcha_enterprise`. -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-recaptcha_enterprise-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-recaptcha_enterprise/Rakefile b/owl-bot-staging/google-cloud-recaptcha_enterprise/Rakefile deleted file mode 100644 index 8801ccc811f1..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recaptcha_enterprise acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECAPTCHA_ENTERPRISE_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 RECAPTCHA_ENTERPRISE_TEST_PROJECT=test123 RECAPTCHA_ENTERPRISE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/credentials" - ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECAPTCHA_ENTERPRISE_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_TEST_PROJECT"] = project - ENV["RECAPTCHA_ENTERPRISE_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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recaptcha_enterprise" - header "google-cloud-recaptcha_enterprise rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recaptcha_enterprise yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise 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-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec b/owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec deleted file mode 100644 index 651c243ec5c8..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/google-cloud-recaptcha_enterprise.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recaptcha_enterprise/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recaptcha_enterprise" - gem.version = Google::Cloud::RecaptchaEnterprise::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "reCAPTCHA Enterprise is a service that protects your site from spam and abuse." - gem.summary = "API Client library for the reCAPTCHA Enterprise 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-recaptcha_enterprise-v1", "~> 1.6" -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.rb deleted file mode 100644 index 7a2eb0be3ece..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google-cloud-recaptcha_enterprise.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/recaptcha_enterprise" unless defined? Google::Cloud::RecaptchaEnterprise::VERSION diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb deleted file mode 100644 index 41fb4337242d..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise.rb +++ /dev/null @@ -1,147 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# 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/recaptcha_enterprise/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! :recaptcha_enterprise 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 RecaptchaEnterprise - ## - # Create a new client object for RecaptchaEnterpriseService. - # - # By default, this returns an instance of - # [Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1/latest/Google-Cloud-RecaptchaEnterprise-V1-RecaptchaEnterpriseService-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 RecaptchaEnterpriseService 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 RecaptchaEnterpriseService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service_available?}. - # - # ## About RecaptchaEnterpriseService - # - # Service to determine the likelihood an event is legitimate. - # - # @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.recaptcha_enterprise_service version: :v1, &block - require "google/cloud/recaptcha_enterprise/#{version.to_s.downcase}" - - package_name = Google::Cloud::RecaptchaEnterprise - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RecaptchaEnterprise.const_get(package_name).const_get(:RecaptchaEnterpriseService) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the RecaptchaEnterpriseService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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 RecaptchaEnterpriseService service, - # or if the versioned client gem needs an update to support the RecaptchaEnterpriseService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.recaptcha_enterprise_service_available? version: :v1 - require "google/cloud/recaptcha_enterprise/#{version.to_s.downcase}" - package_name = Google::Cloud::RecaptchaEnterprise - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RecaptchaEnterprise.const_get package_name - return false unless service_module.const_defined? :RecaptchaEnterpriseService - service_module = service_module.const_get :RecaptchaEnterpriseService - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-recaptcha_enterprise 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.recaptcha_enterprise if block_given? - - ::Google::Cloud.configure.recaptcha_enterprise - end - end - end -end - -helper_path = ::File.join __dir__, "recaptcha_enterprise", "helpers.rb" -require "google/cloud/recaptcha_enterprise/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/version.rb deleted file mode 100644 index 874783301b52..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/lib/google/cloud/recaptcha_enterprise/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 RecaptchaEnterprise - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/client_test.rb deleted file mode 100644 index 8875f83e7aff..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::RecaptchaEnterprise::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_recaptcha_enterprise_service_grpc - skip unless Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_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::RecaptchaEnterprise.recaptcha_enterprise_service do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/version_test.rb deleted file mode 100644 index cfc6497f1d9b..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/google/cloud/recaptcha_enterprise/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/recaptcha_enterprise/version" - -class Google::Cloud::RecaptchaEnterprise::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::RecaptchaEnterprise::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb b/owl-bot-staging/google-cloud-recaptcha_enterprise/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recaptcha_enterprise/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-recommendation_engine-v1beta1/.gitignore b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json deleted file mode 100644 index a31120e1495d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recommendationengine.googleapis.com", - "api_shortname": "recommendationengine", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest", - "distribution_name": "google-cloud-recommendation_engine-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "recommendationengine", - "name_pretty": "Recommendations AI V1beta1 API", - "product_documentation": "https://cloud.google.com/recommendations", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Recommendations AI 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-recommendation_engine-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommendation_engine instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RECOMMENDATION_ENGINE", - "ruby-cloud-product-url": "https://cloud.google.com/recommendations", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml deleted file mode 100644 index 7c6a49f34f55..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recommendation_engine-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-recommendation_engine-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/.yardopts b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts deleted file mode 100644 index 5cd122719b63..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Recommendations AI 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-recommendation_engine-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 3a49ae0f7b1a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recommendation_engine-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-recommendation_engine-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/recommendation_engine/v1beta1" - -client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recommendation_engine/v1beta1" - -::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine-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/recommendation_engine/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/README.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md deleted file mode 100644 index 79a867db8614..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Recommendations AI V1beta1 API - -Recommendations AI service enables customers to build end-to-end personalized recommendation systems without requiring a high level of expertise in machine learning, recommendation system, or Google Cloud. - -Recommendations AI 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 Recommendations AI V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-recommendation_engine](https://rubygems.org/gems/google-cloud-recommendation_engine). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-recommendation_engine-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/recommendationengine.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/recommendation_engine/v1beta1" - -client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new # (request fields as keyword arguments...) -response = client.create_catalog_item request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/recommendations) -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/recommendation_engine/v1beta1" -require "logger" - -client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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-recommendation_engine`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recommendation_engine-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-recommendation_engine`. -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-recommendation_engine-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-recommendation_engine-v1beta1/Rakefile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/Rakefile deleted file mode 100644 index 79b970b8beea..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECOMMENDATION_ENGINE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECOMMENDATION_ENGINE_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 RECOMMENDATION_ENGINE_TEST_PROJECT=test123 RECOMMENDATION_ENGINE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECOMMENDATION_ENGINE_PROJECT"] = project - ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] = project - ENV["RECOMMENDATION_ENGINE_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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recommendation_engine-v1beta1" - header "google-cloud-recommendation_engine-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recommendation_engine-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recommendation_engine-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-recommendation_engine-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-recommendation_engine-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-recommendation_engine-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json deleted file mode 100644 index 8f0427c84ac9..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.recommendationengine.v1beta1", - "libraryPackage": "::Google::Cloud::RecommendationEngine::V1beta1", - "services": { - "CatalogService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client", - "rpcs": { - "CreateCatalogItem": { - "methods": [ - "create_catalog_item" - ] - }, - "GetCatalogItem": { - "methods": [ - "get_catalog_item" - ] - }, - "ListCatalogItems": { - "methods": [ - "list_catalog_items" - ] - }, - "UpdateCatalogItem": { - "methods": [ - "update_catalog_item" - ] - }, - "DeleteCatalogItem": { - "methods": [ - "delete_catalog_item" - ] - }, - "ImportCatalogItems": { - "methods": [ - "import_catalog_items" - ] - } - } - } - } - }, - "PredictionApiKeyRegistry": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client", - "rpcs": { - "CreatePredictionApiKeyRegistration": { - "methods": [ - "create_prediction_api_key_registration" - ] - }, - "ListPredictionApiKeyRegistrations": { - "methods": [ - "list_prediction_api_key_registrations" - ] - }, - "DeletePredictionApiKeyRegistration": { - "methods": [ - "delete_prediction_api_key_registration" - ] - } - } - } - } - }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - } - } - } - } - }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client", - "rpcs": { - "WriteUserEvent": { - "methods": [ - "write_user_event" - ] - }, - "CollectUserEvent": { - "methods": [ - "collect_user_event" - ] - }, - "ListUserEvents": { - "methods": [ - "list_user_events" - ] - }, - "PurgeUserEvents": { - "methods": [ - "purge_user_events" - ] - }, - "ImportUserEvents": { - "methods": [ - "import_user_events" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec deleted file mode 100644 index a68eb959300b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/google-cloud-recommendation_engine-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recommendation_engine/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recommendation_engine-v1beta1" - gem.version = Google::Cloud::RecommendationEngine::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Recommendations AI 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-recommendation_engine-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommendation_engine instead. See the readme for more details." - gem.summary = "Recommendations AI service enables customers to build end-to-end personalized recommendation systems without requiring a high level of expertise in machine learning, recommendation system, or 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" -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-v1beta1.rb deleted file mode 100644 index 6cb219e41a0a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google-cloud-recommendation_engine-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/recommendation_engine/v1beta1" diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1.rb deleted file mode 100644 index b1f7a714c385..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/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/recommendation_engine/v1beta1/catalog_service" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" -require "google/cloud/recommendation_engine/v1beta1/prediction_service" -require "google/cloud/recommendation_engine/v1beta1/user_event_service" -require "google/cloud/recommendation_engine/v1beta1/version" - -module Google - module Cloud - module RecommendationEngine - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/recommendation_engine/v1beta1" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/recommendation_engine/v1beta1" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb deleted file mode 100644 index 342d702f264e..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/paths" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/operations" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/client" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for ingesting catalog information of the customer's website. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recommendation_engine/v1beta1/catalog_service" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - module CatalogService - end - end - end - end -end - -helper_path = ::File.join __dir__, "catalog_service", "helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb deleted file mode 100644 index 1439b6411b77..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +++ /dev/null @@ -1,1028 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module CatalogService - ## - # Client for the CatalogService service. - # - # Service for ingesting catalog information of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :catalog_service_stub - - ## - # Configure the CatalogService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CatalogService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.create_catalog_item.timeout = 600.0 - default_config.rpcs.create_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_catalog_item.timeout = 600.0 - default_config.rpcs.get_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_catalog_items.timeout = 600.0 - default_config.rpcs.list_catalog_items.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_catalog_item.timeout = 600.0 - default_config.rpcs.update_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_catalog_item.timeout = 600.0 - default_config.rpcs.delete_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_catalog_items.timeout = 600.0 - default_config.rpcs.import_catalog_items.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendationengine/v1beta1/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 - - @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 - - @catalog_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RecommendationEngine::V1beta1::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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @catalog_service_stub.logger - end - - # Service calls - - ## - # Creates a catalog item. - # - # @overload create_catalog_item(request, options = nil) - # Pass arguments to `create_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_catalog_item(parent: nil, catalog_item: nil) - # Pass arguments to `create_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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`. - # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] - # Required. The catalog item to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new - # - # # Call the create_catalog_item method. - # result = client.create_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def create_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest - - # Converts hash and nil to 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_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_catalog_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :create_catalog_item, request, 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 specific catalog item. - # - # @overload get_catalog_item(request, options = nil) - # Pass arguments to `get_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_catalog_item(name: nil) - # Pass arguments to `get_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new - # - # # Call the get_catalog_item method. - # result = client.get_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def get_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :get_catalog_item, request, 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 catalog items. - # - # @overload list_catalog_items(request, options = nil) - # Pass arguments to `list_catalog_items` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_catalog_items(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_catalog_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous ListCatalogItemsResponse.next_page_token. - # @param filter [::String] - # Optional. A filter to apply on the list results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new - # - # # Call the list_catalog_items method. - # result = client.list_catalog_items request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p item - # end - # - def list_catalog_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_catalog_items.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_catalog_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :list_catalog_items, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @catalog_service_stub, :list_catalog_items, request, response, 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 catalog item. Partial updating is supported. Non-existing - # items will be created. - # - # @overload update_catalog_item(request, options = nil) - # Pass arguments to `update_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_item(name: nil, catalog_item: nil, update_mask: nil) - # Pass arguments to `update_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] - # Required. The catalog item to update/create. The 'catalog_item_id' field - # has to match that in the 'name'. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided 'item' to update. If not - # set, will by default update all fields. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new - # - # # Call the update_catalog_item method. - # result = client.update_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def update_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest - - # Converts hash and nil to 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_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :update_catalog_item, request, 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 catalog item. - # - # @overload delete_catalog_item(request, options = nil) - # Pass arguments to `delete_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_catalog_item(name: nil) - # Pass arguments to `delete_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new - # - # # Call the delete_catalog_item method. - # result = client.delete_catalog_item request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_catalog_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :delete_catalog_item, request, 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 multiple catalog items. Request processing may be - # synchronous. No partial updating supported. Non-existing items will be - # created. - # - # Operation.response is of type ImportResponse. Note that it is - # possible for a subset of the items to be successfully updated. - # - # @overload import_catalog_items(request, options = nil) - # Pass arguments to `import_catalog_items` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalog_items(parent: nil, request_id: nil, input_config: nil, errors_config: nil) - # Pass arguments to `import_catalog_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 request_id [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency and used for request deduplication. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. - # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] - # Optional. The desired location of errors incurred during the Import. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new - # - # # Call the import_catalog_items method. - # result = client.import_catalog_items request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_catalog_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest - - # Converts hash and nil to 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_catalog_items.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_catalog_items.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_catalog_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.call_rpc :import_catalog_items, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 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::RecommendationEngine::V1beta1::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 - # # create_catalog_item to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_catalog_item.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_catalog_item.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 `create_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :create_catalog_item - ## - # RPC-specific configuration for `get_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :get_catalog_item - ## - # RPC-specific configuration for `list_catalog_items` - # @return [::Gapic::Config::Method] - # - attr_reader :list_catalog_items - ## - # RPC-specific configuration for `update_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :update_catalog_item - ## - # RPC-specific configuration for `delete_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_catalog_item - ## - # RPC-specific configuration for `import_catalog_items` - # @return [::Gapic::Config::Method] - # - attr_reader :import_catalog_items - - # @private - def initialize parent_rpcs = nil - create_catalog_item_config = parent_rpcs.create_catalog_item if parent_rpcs.respond_to? :create_catalog_item - @create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config - get_catalog_item_config = parent_rpcs.get_catalog_item if parent_rpcs.respond_to? :get_catalog_item - @get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config - list_catalog_items_config = parent_rpcs.list_catalog_items if parent_rpcs.respond_to? :list_catalog_items - @list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config - update_catalog_item_config = parent_rpcs.update_catalog_item if parent_rpcs.respond_to? :update_catalog_item - @update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config - delete_catalog_item_config = parent_rpcs.delete_catalog_item if parent_rpcs.respond_to? :delete_catalog_item - @delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config - import_catalog_items_config = parent_rpcs.import_catalog_items if parent_rpcs.respond_to? :import_catalog_items - @import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/credentials.rb deleted file mode 100644 index 55bb84fd8dca..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine - module V1beta1 - module CatalogService - # Credentials for the CatalogService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECOMMENDATION_ENGINE_CREDENTIALS", - "RECOMMENDATION_ENGINE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", - "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb deleted file mode 100644 index f7b7fd807de0..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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 RecommendationEngine - module V1beta1 - module CatalogService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CatalogService 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 CatalogService 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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/paths.rb deleted file mode 100644 index 7d51dc643818..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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 RecommendationEngine - module V1beta1 - module CatalogService - # Path helper methods for the CatalogService 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 CatalogItemPath resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param catalog_item_path [String] - # - # @return [::String] - def catalog_item_path_path project:, location:, catalog:, catalog_item_path: - 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}/catalogItems/#{catalog_item_path}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb deleted file mode 100644 index 462070e6da71..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/paths" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for ingesting catalog information of the customer's website. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/catalog_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb deleted file mode 100644 index 14fb0c1391f0..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb +++ /dev/null @@ -1,943 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module CatalogService - module Rest - ## - # REST client for the CatalogService service. - # - # Service for ingesting catalog information of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :catalog_service_stub - - ## - # Configure the CatalogService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CatalogService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.create_catalog_item.timeout = 600.0 - default_config.rpcs.create_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_catalog_item.timeout = 600.0 - default_config.rpcs.get_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_catalog_items.timeout = 600.0 - default_config.rpcs.list_catalog_items.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_catalog_item.timeout = 600.0 - default_config.rpcs.update_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_catalog_item.timeout = 600.0 - default_config.rpcs.delete_catalog_item.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_catalog_items.timeout = 600.0 - default_config.rpcs.import_catalog_items.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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 - - @operations_client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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 - - @catalog_service_stub = ::Google::Cloud::RecommendationEngine::V1beta1::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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @catalog_service_stub.logger - end - - # Service calls - - ## - # Creates a catalog item. - # - # @overload create_catalog_item(request, options = nil) - # Pass arguments to `create_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_catalog_item(parent: nil, catalog_item: nil) - # Pass arguments to `create_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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`. - # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] - # Required. The catalog item to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new - # - # # Call the create_catalog_item method. - # result = client.create_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def create_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest - - # Converts hash and nil to an 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_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_catalog_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.create_catalog_item request, 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 specific catalog item. - # - # @overload get_catalog_item(request, options = nil) - # Pass arguments to `get_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_catalog_item(name: nil) - # Pass arguments to `get_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new - # - # # Call the get_catalog_item method. - # result = client.get_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def get_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_catalog_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.get_catalog_item request, 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 catalog items. - # - # @overload list_catalog_items(request, options = nil) - # Pass arguments to `list_catalog_items` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_catalog_items(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_catalog_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous ListCatalogItemsResponse.next_page_token. - # @param filter [::String] - # Optional. A filter to apply on the list results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new - # - # # Call the list_catalog_items method. - # result = client.list_catalog_items request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p item - # end - # - def list_catalog_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_catalog_items.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_catalog_items.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_catalog_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.list_catalog_items request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @catalog_service_stub, :list_catalog_items, "catalog_items", request, result, 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 catalog item. Partial updating is supported. Non-existing - # items will be created. - # - # @overload update_catalog_item(request, options = nil) - # Pass arguments to `update_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, 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_item(name: nil, catalog_item: nil, update_mask: nil) - # Pass arguments to `update_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - # @param catalog_item [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem, ::Hash] - # Required. The catalog item to update/create. The 'catalog_item_id' field - # has to match that in the 'name'. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided 'item' to update. If not - # set, will by default update all fields. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new - # - # # Call the update_catalog_item method. - # result = client.update_catalog_item request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - # p result - # - def update_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest - - # Converts hash and nil to an 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_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.update_catalog_item request, 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 catalog item. - # - # @overload delete_catalog_item(request, options = nil) - # Pass arguments to `delete_catalog_item` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_catalog_item(name: nil) - # Pass arguments to `delete_catalog_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new - # - # # Call the delete_catalog_item method. - # result = client.delete_catalog_item request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_catalog_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest - - # Converts hash and nil to an 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_catalog_item.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_catalog_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_catalog_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.delete_catalog_item request, 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 multiple catalog items. Request processing may be - # synchronous. No partial updating supported. Non-existing items will be - # created. - # - # Operation.response is of type ImportResponse. Note that it is - # possible for a subset of the items to be successfully updated. - # - # @overload import_catalog_items(request, options = nil) - # Pass arguments to `import_catalog_items` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_catalog_items(parent: nil, request_id: nil, input_config: nil, errors_config: nil) - # Pass arguments to `import_catalog_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 request_id [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency and used for request deduplication. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. - # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] - # Optional. The desired location of errors incurred during the Import. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new - # - # # Call the import_catalog_items method. - # result = client.import_catalog_items request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_catalog_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest - - # Converts hash and nil to an 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_catalog_items.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_catalog_items.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_catalog_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @catalog_service_stub.import_catalog_items request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 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::RecommendationEngine::V1beta1::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 - # # create_catalog_item to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_catalog_item.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_catalog_item.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 `create_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :create_catalog_item - ## - # RPC-specific configuration for `get_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :get_catalog_item - ## - # RPC-specific configuration for `list_catalog_items` - # @return [::Gapic::Config::Method] - # - attr_reader :list_catalog_items - ## - # RPC-specific configuration for `update_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :update_catalog_item - ## - # RPC-specific configuration for `delete_catalog_item` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_catalog_item - ## - # RPC-specific configuration for `import_catalog_items` - # @return [::Gapic::Config::Method] - # - attr_reader :import_catalog_items - - # @private - def initialize parent_rpcs = nil - create_catalog_item_config = parent_rpcs.create_catalog_item if parent_rpcs.respond_to? :create_catalog_item - @create_catalog_item = ::Gapic::Config::Method.new create_catalog_item_config - get_catalog_item_config = parent_rpcs.get_catalog_item if parent_rpcs.respond_to? :get_catalog_item - @get_catalog_item = ::Gapic::Config::Method.new get_catalog_item_config - list_catalog_items_config = parent_rpcs.list_catalog_items if parent_rpcs.respond_to? :list_catalog_items - @list_catalog_items = ::Gapic::Config::Method.new list_catalog_items_config - update_catalog_item_config = parent_rpcs.update_catalog_item if parent_rpcs.respond_to? :update_catalog_item - @update_catalog_item = ::Gapic::Config::Method.new update_catalog_item_config - delete_catalog_item_config = parent_rpcs.delete_catalog_item if parent_rpcs.respond_to? :delete_catalog_item - @delete_catalog_item = ::Gapic::Config::Method.new delete_catalog_item_config - import_catalog_items_config = parent_rpcs.import_catalog_items if parent_rpcs.respond_to? :import_catalog_items - @import_catalog_items = ::Gapic::Config::Method.new import_catalog_items_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb deleted file mode 100644 index 1ada71023727..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb +++ /dev/null @@ -1,939 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 RecommendationEngine - module V1beta1 - module CatalogService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CatalogService 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 CatalogService 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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, 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/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb deleted file mode 100644 index 929ca1250ba5..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb +++ /dev/null @@ -1,450 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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 create_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # A result object deserialized from the server's reply - def create_catalog_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_catalog_item_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_catalog_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # A result object deserialized from the server's reply - def get_catalog_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_catalog_item_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_catalog_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.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_catalog_items REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse] - # A result object deserialized from the server's reply - def list_catalog_items request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_catalog_items_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_catalog_items", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.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_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # A result object deserialized from the server's reply - def update_catalog_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_catalog_item_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.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_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_catalog_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_catalog_item_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_catalog_item", - 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 import_catalog_items REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_catalog_items request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_catalog_items_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_catalog_items", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest] - # 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_catalog_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/catalogItems", - body: "catalog_item", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_catalog_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_catalog_items REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_catalog_items_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/catalogItems", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest] - # 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_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{name}", - body: "catalog_item", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_catalog_item REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest] - # 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_catalog_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/catalogItems(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_catalog_items REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest] - # 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_catalog_items_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/catalogItems: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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb deleted file mode 100644 index 488d9aad1bec..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - module PredictionApiKeyRegistry - end - end - end - end -end - -helper_path = ::File.join __dir__, "prediction_api_key_registry", "helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb deleted file mode 100644 index 7171f8f90718..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +++ /dev/null @@ -1,693 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - ## - # Client for the PredictionApiKeyRegistry service. - # - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_api_key_registry_stub - - ## - # Configure the PredictionApiKeyRegistry Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionApiKeyRegistry clients - # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RecommendationEngine", "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.create_prediction_api_key_registration.timeout = 600.0 - default_config.rpcs.create_prediction_api_key_registration.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0 - default_config.rpcs.list_prediction_api_key_registrations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0 - default_config.rpcs.delete_prediction_api_key_registration.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 PredictionApiKeyRegistry Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam 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_api_key_registry_stub.universe_domain - end - - ## - # Create a new PredictionApiKeyRegistry client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionApiKeyRegistry 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/recommendationengine/v1beta1/prediction_apikey_registry_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 - - @prediction_api_key_registry_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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 - ) - - @prediction_api_key_registry_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 - @prediction_api_key_registry_stub.logger - end - - # Service calls - - ## - # Register an API key for use with predict method. - # - # @overload create_prediction_api_key_registration(request, options = nil) - # Pass arguments to `create_prediction_api_key_registration` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) - # Pass arguments to `create_prediction_api_key_registration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash] - # Required. The prediction API key registration. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new - # - # # Call the create_prediction_api_key_registration method. - # result = client.create_prediction_api_key_registration request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - # p result - # - def create_prediction_api_key_registration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest - - # Converts hash and nil to 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_prediction_api_key_registration.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_prediction_api_key_registration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.call_rpc :create_prediction_api_key_registration, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List the registered apiKeys for use with predict method. - # - # @overload list_prediction_api_key_registrations(request, options = nil) - # Pass arguments to `list_prediction_api_key_registrations` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_prediction_api_key_registrations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 placement resource name such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If unset, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new - # - # # Call the list_prediction_api_key_registrations method. - # result = client.list_prediction_api_key_registrations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - # p item - # end - # - def list_prediction_api_key_registrations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_prediction_api_key_registrations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.call_rpc :list_prediction_api_key_registrations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @prediction_api_key_registry_stub, :list_prediction_api_key_registrations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Unregister an apiKey from using for predict method. - # - # @overload delete_prediction_api_key_registration(request, options = nil) - # Pass arguments to `delete_prediction_api_key_registration` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_prediction_api_key_registration(name: nil) - # Pass arguments to `delete_prediction_api_key_registration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The API key to unregister including full resource path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new - # - # # Call the delete_prediction_api_key_registration method. - # result = client.delete_prediction_api_key_registration request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_prediction_api_key_registration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_prediction_api_key_registration.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_prediction_api_key_registration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.call_rpc :delete_prediction_api_key_registration, request, 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 PredictionApiKeyRegistry API. - # - # This class represents the configuration for PredictionApiKeyRegistry, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_prediction_api_key_registration to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 PredictionApiKeyRegistry API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_prediction_api_key_registration` - # @return [::Gapic::Config::Method] - # - attr_reader :create_prediction_api_key_registration - ## - # RPC-specific configuration for `list_prediction_api_key_registrations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_prediction_api_key_registrations - ## - # RPC-specific configuration for `delete_prediction_api_key_registration` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_prediction_api_key_registration - - # @private - def initialize parent_rpcs = nil - create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration - @create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config - list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations - @list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config - delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration - @delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials.rb deleted file mode 100644 index 52b5f39a892a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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 RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - # Credentials for the PredictionApiKeyRegistry API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECOMMENDATION_ENGINE_CREDENTIALS", - "RECOMMENDATION_ENGINE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", - "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths.rb deleted file mode 100644 index 1cf2615f5f4b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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 RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - # Path helper methods for the PredictionApiKeyRegistry API. - module Paths - ## - # Create a fully-qualified EventStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param event_store [String] - # - # @return [::String] - def event_store_path project:, location:, catalog:, event_store: - 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}/eventStores/#{event_store}" - end - - ## - # Create a fully-qualified PredictionApiKeyRegistration resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param event_store [String] - # @param prediction_api_key_registration [String] - # - # @return [::String] - def prediction_api_key_registration_path project:, location:, catalog:, event_store:, prediction_api_key_registration: - 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, "event_store cannot contain /" if event_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/eventStores/#{event_store}/predictionApiKeyRegistrations/#{prediction_api_key_registration}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb deleted file mode 100644 index 516caac30c53..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/credentials" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/paths" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - module PredictionApiKeyRegistry - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb deleted file mode 100644 index 5146996f7720..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.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/errors" -require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - module Rest - ## - # REST client for the PredictionApiKeyRegistry service. - # - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_api_key_registry_stub - - ## - # Configure the PredictionApiKeyRegistry Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionApiKeyRegistry clients - # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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", "RecommendationEngine", "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.create_prediction_api_key_registration.timeout = 600.0 - default_config.rpcs.create_prediction_api_key_registration.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_prediction_api_key_registrations.timeout = 600.0 - default_config.rpcs.list_prediction_api_key_registrations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_prediction_api_key_registration.timeout = 600.0 - default_config.rpcs.delete_prediction_api_key_registration.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 PredictionApiKeyRegistry Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_api_key_registry_stub.universe_domain - end - - ## - # Create a new PredictionApiKeyRegistry REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionApiKeyRegistry 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_api_key_registry_stub = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @prediction_api_key_registry_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 - @prediction_api_key_registry_stub.logger - end - - # Service calls - - ## - # Register an API key for use with predict method. - # - # @overload create_prediction_api_key_registration(request, options = nil) - # Pass arguments to `create_prediction_api_key_registration` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_prediction_api_key_registration(parent: nil, prediction_api_key_registration: nil) - # Pass arguments to `create_prediction_api_key_registration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param prediction_api_key_registration [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration, ::Hash] - # Required. The prediction API key registration. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new - # - # # Call the create_prediction_api_key_registration method. - # result = client.create_prediction_api_key_registration request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - # p result - # - def create_prediction_api_key_registration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest - - # Converts hash and nil to an 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_prediction_api_key_registration.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_prediction_api_key_registration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_prediction_api_key_registration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.create_prediction_api_key_registration request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List the registered apiKeys for use with predict method. - # - # @overload list_prediction_api_key_registrations(request, options = nil) - # Pass arguments to `list_prediction_api_key_registrations` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_prediction_api_key_registrations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_prediction_api_key_registrations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 placement resource name such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If unset, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new - # - # # Call the list_prediction_api_key_registrations method. - # result = client.list_prediction_api_key_registrations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - # p item - # end - # - def list_prediction_api_key_registrations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_prediction_api_key_registrations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_prediction_api_key_registrations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_prediction_api_key_registrations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.list_prediction_api_key_registrations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @prediction_api_key_registry_stub, :list_prediction_api_key_registrations, "prediction_api_key_registrations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Unregister an apiKey from using for predict method. - # - # @overload delete_prediction_api_key_registration(request, options = nil) - # Pass arguments to `delete_prediction_api_key_registration` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_prediction_api_key_registration(name: nil) - # Pass arguments to `delete_prediction_api_key_registration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The API key to unregister including full resource path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - # @yield [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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new - # - # # Call the delete_prediction_api_key_registration method. - # result = client.delete_prediction_api_key_registration request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_prediction_api_key_registration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest - - # Converts hash and nil to an 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_prediction_api_key_registration.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_prediction_api_key_registration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_prediction_api_key_registration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @prediction_api_key_registry_stub.delete_prediction_api_key_registration request, 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 PredictionApiKeyRegistry REST API. - # - # This class represents the configuration for PredictionApiKeyRegistry 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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_prediction_api_key_registration.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 PredictionApiKeyRegistry API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_prediction_api_key_registration` - # @return [::Gapic::Config::Method] - # - attr_reader :create_prediction_api_key_registration - ## - # RPC-specific configuration for `list_prediction_api_key_registrations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_prediction_api_key_registrations - ## - # RPC-specific configuration for `delete_prediction_api_key_registration` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_prediction_api_key_registration - - # @private - def initialize parent_rpcs = nil - create_prediction_api_key_registration_config = parent_rpcs.create_prediction_api_key_registration if parent_rpcs.respond_to? :create_prediction_api_key_registration - @create_prediction_api_key_registration = ::Gapic::Config::Method.new create_prediction_api_key_registration_config - list_prediction_api_key_registrations_config = parent_rpcs.list_prediction_api_key_registrations if parent_rpcs.respond_to? :list_prediction_api_key_registrations - @list_prediction_api_key_registrations = ::Gapic::Config::Method.new list_prediction_api_key_registrations_config - delete_prediction_api_key_registration_config = parent_rpcs.delete_prediction_api_key_registration if parent_rpcs.respond_to? :delete_prediction_api_key_registration - @delete_prediction_api_key_registration = ::Gapic::Config::Method.new delete_prediction_api_key_registration_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb deleted file mode 100644 index 21970efd2ca1..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/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/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - module Rest - ## - # REST service stub for the PredictionApiKeyRegistry 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_prediction_api_key_registration REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # A result object deserialized from the server's reply - def create_prediction_api_key_registration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_prediction_api_key_registration_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_prediction_api_key_registration", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.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_prediction_api_key_registrations REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse] - # A result object deserialized from the server's reply - def list_prediction_api_key_registrations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_prediction_api_key_registrations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_prediction_api_key_registrations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.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_prediction_api_key_registration REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_prediction_api_key_registration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_prediction_api_key_registration_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_prediction_api_key_registration", - 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 create_prediction_api_key_registration REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest] - # 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_prediction_api_key_registration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/predictionApiKeyRegistrations", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_prediction_api_key_registrations REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_prediction_api_key_registrations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/predictionApiKeyRegistrations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_prediction_api_key_registration REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest] - # 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_prediction_api_key_registration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/predictionApiKeyRegistrations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb deleted file mode 100644 index 6606f683a13b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/prediction_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/paths" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/client" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for making recommendation prediction. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_service" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new - # - module PredictionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "prediction_service", "helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb deleted file mode 100644 index c508930ad25d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +++ /dev/null @@ -1,575 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionService - ## - # Client for the PredictionService service. - # - # Service for making recommendation prediction. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_service_stub - - ## - # Configure the PredictionService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "RecommendationEngine", "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.predict.timeout = 600.0 - default_config.rpcs.predict.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 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::RecommendationEngine::V1beta1::PredictionService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam 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 client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PredictionService 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/recommendationengine/v1beta1/prediction_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 - - @prediction_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::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 - ) - - @prediction_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @prediction_service_stub.logger - end - - # Service calls - - ## - # Makes a recommendation prediction. If using API Key based authentication, - # the API Key must be registered using the - # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client PredictionApiKeyRegistry} - # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). - # - # @overload predict(request, options = nil) - # Pass arguments to `predict` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(name: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, dry_run: 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 name [::String] - # Required. Full resource name of the format: - # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - # The id of the recommendation engine placement. This id is used to identify - # the set of models that will be used to make the prediction. - # - # We currently support three placements with the following IDs by default: - # - # * `shopping_cart`: Predicts items frequently bought together with one or - # more catalog items in the same shopping session. Commonly displayed after - # `add-to-cart` events, on product detail pages, or on the shopping cart - # page. - # - # * `home_page`: Predicts the next product that a user will most likely - # engage with or purchase based on the shopping or viewing history of the - # specified `userId` or `visitorId`. For example - Recommendations for you. - # - # * `product_detail`: Predicts the next product that a user will most likely - # engage with or purchase. The prediction is based on the shopping or - # viewing history of the specified `userId` or `visitorId` and its - # relevance to a specified `CatalogItem`. Typically used on product detail - # pages. For example - More items like this. - # - # * `recently_viewed_default`: Returns up to 75 items recently viewed by the - # specified `userId` or `visitorId`, most recent ones first. Returns - # nothing if neither of them has viewed any items yet. For example - - # Recently viewed. - # - # The full list of available placements can be seen at - # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::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. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. Set this property - # to the number of prediction results required. If zero, the service will - # choose a reasonable default. - # @param page_token [::String] - # Optional. The previous PredictResponse.next_page_token. - # @param filter [::String] - # Optional. Filter for restricting prediction results. Accepts values for - # tags and the `filterOutOfStockItems` flag. - # - # * Tag expressions. Restricts predictions to items 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 KiB. - # - # * filterOutOfStockItems. Restricts predictions to items 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 - # @param dry_run [::Boolean] - # Optional. Use dryRun mode for this prediction query. If set to true, a - # dummy model will be used that returns arbitrary catalog items. - # Note that the dryRun mode should only be used for testing the API, or if - # the model is not ready. - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # Optional. Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - # object will be returned in the - # `PredictResponse.PredictionResult.itemMetadata` object in the method - # response. - # * `returnItemScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned item will be set in the `metadata` - # field in the prediction response. The given 'score' indicates the - # probability of an item being clicked/purchased given the user's context - # and history. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels for the predict request. - # - # * Label keys can contain lowercase letters, digits and hyphens, must start - # with a letter, and must end with a letter or digit. - # * Non-zero label values can contain lowercase letters, digits and hyphens, - # must start with a letter, and must end with a letter or digit. - # * No more than 64 labels can be associated with a given request. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. - # p item - # end - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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| - response = ::Gapic::PagedEnumerable.new @prediction_service_stub, :predict, request, response, 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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/credentials.rb deleted file mode 100644 index 1fd7c72d3267..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine - module V1beta1 - module PredictionService - # Credentials for the PredictionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECOMMENDATION_ENGINE_CREDENTIALS", - "RECOMMENDATION_ENGINE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", - "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/paths.rb deleted file mode 100644 index eff694916ded..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine - module V1beta1 - module PredictionService - # Path helper methods for the PredictionService API. - module Paths - ## - # Create a fully-qualified Placement resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param event_store [String] - # @param placement [String] - # - # @return [::String] - def placement_path project:, location:, catalog:, event_store:, placement: - 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, "event_store cannot contain /" if event_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/catalogs/#{catalog}/eventStores/#{event_store}/placements/#{placement}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb deleted file mode 100644 index 8138f6257d3a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/prediction_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/paths" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for making recommendation prediction. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/prediction_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb deleted file mode 100644 index 47cda025f951..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb +++ /dev/null @@ -1,525 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionService - module Rest - ## - # REST client for the PredictionService service. - # - # Service for making recommendation prediction. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :prediction_service_stub - - ## - # Configure the PredictionService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PredictionService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.predict.timeout = 600.0 - default_config.rpcs.predict.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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @prediction_service_stub.logger - end - - # Service calls - - ## - # Makes a recommendation prediction. If using API Key based authentication, - # the API Key must be registered using the - # {::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client PredictionApiKeyRegistry} - # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). - # - # @overload predict(request, options = nil) - # Pass arguments to `predict` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(name: nil, user_event: nil, page_size: nil, page_token: nil, filter: nil, dry_run: 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 name [::String] - # Required. Full resource name of the format: - # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - # The id of the recommendation engine placement. This id is used to identify - # the set of models that will be used to make the prediction. - # - # We currently support three placements with the following IDs by default: - # - # * `shopping_cart`: Predicts items frequently bought together with one or - # more catalog items in the same shopping session. Commonly displayed after - # `add-to-cart` events, on product detail pages, or on the shopping cart - # page. - # - # * `home_page`: Predicts the next product that a user will most likely - # engage with or purchase based on the shopping or viewing history of the - # specified `userId` or `visitorId`. For example - Recommendations for you. - # - # * `product_detail`: Predicts the next product that a user will most likely - # engage with or purchase. The prediction is based on the shopping or - # viewing history of the specified `userId` or `visitorId` and its - # relevance to a specified `CatalogItem`. Typically used on product detail - # pages. For example - More items like this. - # - # * `recently_viewed_default`: Returns up to 75 items recently viewed by the - # specified `userId` or `visitorId`, most recent ones first. Returns - # nothing if neither of them has viewed any items yet. For example - - # Recently viewed. - # - # The full list of available placements can be seen at - # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::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. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. Set this property - # to the number of prediction results required. If zero, the service will - # choose a reasonable default. - # @param page_token [::String] - # Optional. The previous PredictResponse.next_page_token. - # @param filter [::String] - # Optional. Filter for restricting prediction results. Accepts values for - # tags and the `filterOutOfStockItems` flag. - # - # * Tag expressions. Restricts predictions to items 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 KiB. - # - # * filterOutOfStockItems. Restricts predictions to items 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 - # @param dry_run [::Boolean] - # Optional. Use dryRun mode for this prediction query. If set to true, a - # dummy model will be used that returns arbitrary catalog items. - # Note that the dryRun mode should only be used for testing the API, or if - # the model is not ready. - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # Optional. Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - # object will be returned in the - # `PredictResponse.PredictionResult.itemMetadata` object in the method - # response. - # * `returnItemScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned item will be set in the `metadata` - # field in the prediction response. The given 'score' indicates the - # probability of an item being clicked/purchased given the user's context - # and history. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels for the predict request. - # - # * Label keys can contain lowercase letters, digits and hyphens, must start - # with a letter, and must end with a letter or digit. - # * Non-zero label values can contain lowercase letters, digits and hyphens, - # must start with a letter, and must end with a letter or digit. - # * No more than 64 labels can be associated with a given request. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new - # - # # Call the predict method. - # result = client.predict request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. - # p item - # end - # - def predict request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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| - result = ::Gapic::Rest::PagedEnumerable.new @prediction_service_stub, :predict, "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 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb deleted file mode 100644 index d112dcff7d84..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_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/recommendationengine/v1beta1/prediction_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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: "/v1beta1/{name}:predict", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/placements/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb deleted file mode 100644 index 90deba258f5d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/rest.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" -require "google/cloud/recommendation_engine/v1beta1/version" - -module Google - module Cloud - module RecommendationEngine - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/recommendation_engine/v1beta1/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb deleted file mode 100644 index 5fdccac0e3d9..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/operations" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/client" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for ingesting end user actions on the customer website. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recommendation_engine/v1beta1/user_event_service" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - module UserEventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb deleted file mode 100644 index ddb0a7f2ac6b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +++ /dev/null @@ -1,1009 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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 = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.write_user_event.timeout = 600.0 - default_config.rpcs.write_user_event.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.collect_user_event.timeout = 600.0 - default_config.rpcs.collect_user_event.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_user_events.timeout = 600.0 - default_config.rpcs.list_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_user_events.timeout = 600.0 - default_config.rpcs.purge_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 60.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: 60.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendationengine/v1beta1/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::RecommendationEngine::V1beta1::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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Operations] - # - attr_reader :operations_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::RecommendationEngine::V1beta1::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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) - # 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 eventStore resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent, ::Hash] - # Required. User event to write. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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. This uses a GET request to - # due to browser restriction of POST-ing to a 3rd party domain. - # - # This method is used only by the Recommendations AI JavaScript pixel. - # 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::RecommendationEngine::V1beta1::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(parent: nil, user_event: nil, uri: nil, ets: 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 parent [::String] - # Required. The parent eventStore name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto. - # @param uri [::String] - # Optional. The url including cgi-parameters but excluding the hash fragment. - # The URL must be truncated to 1.5K bytes to conservatively be under the 2K - # bytes. This is often more useful than the referer url, because many - # browsers only send the domain for 3rd party requests. - # @param ets [::Integer] - # Optional. The event timestamp in milliseconds. This prevents browser - # caching of otherwise identical get requests. The name is abbreviated to - # reduce the payload bytes. - # - # @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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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 - - ## - # Gets a list of user events within a time range, with potential filtering. - # - # @overload list_user_events(request, options = nil) - # Pass arguments to `list_user_events` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_user_events(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_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 eventStore resource name, such as - # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous ListUserEventsResponse.next_page_token. - # @param filter [::String] - # Optional. Filtering expression to specify restrictions over - # returned events. This is a sequence of terms, where each term applies some - # kind of a restriction to the returned user events. Use this expression to - # restrict results to a specific time range, or filter events by eventType. - # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - # eventTime<"2012-04-23T18:25:43.511Z" eventType=search - # - # We expect only 3 types of fields: - # - # * eventTime: this can be specified a maximum of 2 times, once with a - # less than operator and once with a greater than operator. The - # eventTime restrict should result in one contiguous valid eventTime - # range. - # - # * eventType: only 1 eventType restriction can be specified. - # - # * eventsMissingCatalogItems: specififying this will restrict results - # to events for which catalog items were not found in the catalog. The - # default behavior is to return only those events for which catalog - # items were found. - # - # Some examples of valid filters expressions: - # - # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" - # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - # eventType = detail-page-view - # * Example 3: eventsMissingCatalogItems - # eventType = search eventTime < "2018-04-23T18:30:43.511Z" - # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - # * Example 5: eventType = search - # * Example 6: eventsMissingCatalogItems - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new - # - # # Call the list_user_events method. - # result = client.list_user_events request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. - # p item - # end - # - def list_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :list_user_events, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @user_event_service_stub, :list_user_events, request, response, operation, options - yield response, operation if block_given? - throw :response, response - 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::RecommendationEngine::V1beta1::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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 event_store under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - # @param filter [::String] - # Required. The filter string to specify the events to be deleted. Empty - # string filter is not allowed. This filter can also be used with - # ListUserEvents API to list events that will be deleted. The eligible fields - # for filtering are: - # * eventType - UserEvent.eventType field of type string. - # * eventTime - in ISO 8601 "zulu" format. - # * visitorId - field of type string. Specifying this will delete all events - # associated with a visitor. - # * userId - field of type string. Specifying this will delete all events - # associated with a user. - # Example 1: Deleting all events in a time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - # "2012-04-23T18:30:43.511Z"` - # Example 2: Deleting specific eventType in time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # Example 3: Deleting all events for a specific visitor - # `visitorId = visitor1024` - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # Optional. The default value is false. Override this flag to true to - # actually perform the purge. If the field is not set to true, a sampling of - # events to be deleted 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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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::RecommendationEngine::V1beta1::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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, request_id: 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/eventStores/default_event_store` - # @param request_id [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency for expensive long running operations. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. Note that - # this field must not be set if the desired input config is - # catalog_inline_source. - # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] - # Optional. The desired location of errors incurred during the Import. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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 - - ## - # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 `list_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_user_events - ## - # 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 - - # @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 - list_user_events_config = parent_rpcs.list_user_events if parent_rpcs.respond_to? :list_user_events - @list_user_events = ::Gapic::Config::Method.new list_user_events_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 - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/credentials.rb deleted file mode 100644 index 65b6d6c63678..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine - module V1beta1 - module UserEventService - # Credentials for the UserEventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECOMMENDATION_ENGINE_CREDENTIALS", - "RECOMMENDATION_ENGINE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECOMMENDATION_ENGINE_CREDENTIALS_JSON", - "RECOMMENDATION_ENGINE_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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb deleted file mode 100644 index e6599fe35c8b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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 RecommendationEngine - module V1beta1 - module UserEventService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RecommendationEngine::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/paths.rb deleted file mode 100644 index da81c45f4fec..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_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 RecommendationEngine - module V1beta1 - module UserEventService - # Path helper methods for the UserEventService API. - module Paths - ## - # Create a fully-qualified EventStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}` - # - # @param project [String] - # @param location [String] - # @param catalog [String] - # @param event_store [String] - # - # @return [::String] - def event_store_path project:, location:, catalog:, event_store: - 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}/eventStores/#{event_store}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb deleted file mode 100644 index 017cec1db63d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/version" - -require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentials" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - ## - # Service for ingesting end user actions on the customer website. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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/recommendation_engine/v1beta1/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb deleted file mode 100644 index ced8adea21fb..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb +++ /dev/null @@ -1,931 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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 = "recommendationengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::RecommendationEngine::V1beta1::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", "RecommendationEngine", "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.write_user_event.timeout = 600.0 - default_config.rpcs.write_user_event.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.collect_user_event.timeout = 600.0 - default_config.rpcs.collect_user_event.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_user_events.timeout = 600.0 - default_config.rpcs.list_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_user_events.timeout = 600.0 - default_config.rpcs.purge_user_events.retry_policy = { - initial_delay: 0.1, max_delay: 60.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: 60.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Operations] - # - attr_reader :operations_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::RecommendationEngine::V1beta1::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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) - # 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 eventStore resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param user_event [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent, ::Hash] - # Required. User event to write. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. This uses a GET request to - # due to browser restriction of POST-ing to a 3rd party domain. - # - # This method is used only by the Recommendations AI JavaScript pixel. - # 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::RecommendationEngine::V1beta1::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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(parent: nil, user_event: nil, uri: nil, ets: 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 parent [::String] - # Required. The parent eventStore name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto. - # @param uri [::String] - # Optional. The url including cgi-parameters but excluding the hash fragment. - # The URL must be truncated to 1.5K bytes to conservatively be under the 2K - # bytes. This is often more useful than the referer url, because many - # browsers only send the domain for 3rd party requests. - # @param ets [::Integer] - # Optional. The event timestamp in milliseconds. This prevents browser - # caching of otherwise identical get requests. The name is abbreviated to - # reduce the payload bytes. - # @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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # Gets a list of user events within a time range, with potential filtering. - # - # @overload list_user_events(request, options = nil) - # Pass arguments to `list_user_events` via a request object, either of type - # {::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_user_events(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_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 eventStore resource name, such as - # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @param page_token [::String] - # Optional. The previous ListUserEventsResponse.next_page_token. - # @param filter [::String] - # Optional. Filtering expression to specify restrictions over - # returned events. This is a sequence of terms, where each term applies some - # kind of a restriction to the returned user events. Use this expression to - # restrict results to a specific time range, or filter events by eventType. - # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - # eventTime<"2012-04-23T18:25:43.511Z" eventType=search - # - # We expect only 3 types of fields: - # - # * eventTime: this can be specified a maximum of 2 times, once with a - # less than operator and once with a greater than operator. The - # eventTime restrict should result in one contiguous valid eventTime - # range. - # - # * eventType: only 1 eventType restriction can be specified. - # - # * eventsMissingCatalogItems: specififying this will restrict results - # to events for which catalog items were not found in the catalog. The - # default behavior is to return only those events for which catalog - # items were found. - # - # Some examples of valid filters expressions: - # - # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" - # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - # eventType = detail-page-view - # * Example 3: eventsMissingCatalogItems - # eventType = search eventTime < "2018-04-23T18:30:43.511Z" - # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - # * Example 5: eventType = search - # * Example 6: eventsMissingCatalogItems - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new - # - # # Call the list_user_events method. - # result = client.list_user_events request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. - # p item - # end - # - def list_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.list_user_events request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @user_event_service_stub, :list_user_events, "user_events", request, result, 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 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::RecommendationEngine::V1beta1::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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 event_store under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - # @param filter [::String] - # Required. The filter string to specify the events to be deleted. Empty - # string filter is not allowed. This filter can also be used with - # ListUserEvents API to list events that will be deleted. The eligible fields - # for filtering are: - # * eventType - UserEvent.eventType field of type string. - # * eventTime - in ISO 8601 "zulu" format. - # * visitorId - field of type string. Specifying this will delete all events - # associated with a visitor. - # * userId - field of type string. Specifying this will delete all events - # associated with a user. - # Example 1: Deleting all events in a time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - # "2012-04-23T18:30:43.511Z"` - # Example 2: Deleting specific eventType in time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # Example 3: Deleting all events for a specific visitor - # `visitorId = visitor1024` - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # Optional. The default value is false. Override this flag to true to - # actually perform the purge. If the field is not set to true, a sampling of - # events to be deleted 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/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::RecommendationEngine::V1beta1::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, request_id: 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/eventStores/default_event_store` - # @param request_id [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency for expensive long running operations. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. Note that - # this field must not be set if the desired input config is - # catalog_inline_source. - # @param input_config [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig, ::Hash] - # Required. The desired input location of the data. - # @param errors_config [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig, ::Hash] - # Optional. The desired location of errors incurred during the Import. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommendation_engine/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - ## - # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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 `list_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_user_events - ## - # 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 - - # @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 - list_user_events_config = parent_rpcs.list_user_events if parent_rpcs.respond_to? :list_user_events - @list_user_events = ::Gapic::Config::Method.new list_user_events_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 - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb deleted file mode 100644 index 2329f9a65f28..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb +++ /dev/null @@ -1,939 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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 RecommendationEngine - module V1beta1 - module UserEventService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommendationengine.$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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::RecommendationEngine::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "recommendationengine.googleapis.com" - - config_attr :endpoint, nil, ::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/[^/]+/catalogs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, 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/[^/]+/catalogs/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/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-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb deleted file mode 100644 index 9ec10550f3fd..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_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/recommendationengine/v1beta1/user_event_service_pb" - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 list_user_events REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse] - # A result object deserialized from the server's reply - def list_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_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: "list_user_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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 - - ## - # @private - # - # GRPC transcoding helper method for the write_user_event REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:write", - body: "user_event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the collect_user_event REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:collect", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_user_events REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/userEvents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_user_events REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_user_events REST call - # - # @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::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: "/v1beta1/{parent}/userEvents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/version.rb deleted file mode 100644 index a09600872115..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/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 RecommendationEngine - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb deleted file mode 100644 index bd0faa39115e..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/catalog.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/recommendationengine/v1beta1/common_pb' - - -descriptor_data = "\n7google/cloud/recommendationengine/v1beta1/catalog.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x36google/cloud/recommendationengine/v1beta1/common.proto\"\xfe\x03\n\x0b\x43\x61talogItem\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12k\n\x14\x63\x61tegory_hierarchies\x18\x02 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12S\n\x0fitem_attributes\x18\x05 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\ritem_group_id\x18\t \x01(\tB\x03\xe0\x41\x01\x12^\n\x10product_metadata\x18\n \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ProductCatalogItemB\x03\xe0\x41\x01H\x00\x1a,\n\x11\x43\x61tegoryHierarchy\x12\x17\n\ncategories\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x15\n\x13recommendation_type\"\xe6\x06\n\x12ProductCatalogItem\x12\x64\n\x0b\x65xact_price\x18\x01 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceB\x03\xe0\x41\x01H\x00\x12\x64\n\x0bprice_range\x18\x02 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeB\x03\xe0\x41\x01H\x00\x12\\\n\x05\x63osts\x18\x03 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.CostsEntryB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x62\n\x0bstock_state\x18\x05 \x01(\x0e\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockStateB\x03\xe0\x41\x01\x12\x1f\n\x12\x61vailable_quantity\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12\"\n\x15\x63\x61nonical_product_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x06images\x18\x08 \x03(\x0b\x32\x30.google.cloud.recommendationengine.v1beta1.ImageB\x03\xe0\x41\x01\x1a\x45\n\nExactPrice\x12\x1a\n\rdisplay_price\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01\x12\x1b\n\x0eoriginal_price\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x1a\x30\n\nPriceRange\x12\x10\n\x03min\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x12\x10\n\x03max\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x1a,\n\nCostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\"j\n\nStockState\x12\x1b\n\x17STOCK_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08IN_STOCK\x10\x00\x12\x10\n\x0cOUT_OF_STOCK\x10\x01\x12\x0c\n\x08PREORDER\x10\x02\x12\r\n\tBACKORDER\x10\x03\x1a\x02\x10\x01\x42\x07\n\x05price\"B\n\x05Image\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06height\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05width\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.FeatureMap", "google/cloud/recommendationengine/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 RecommendationEngine - module V1beta1 - CatalogItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogItem").msgclass - CatalogItem::CategoryHierarchy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy").msgclass - ProductCatalogItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem").msgclass - ProductCatalogItem::ExactPrice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice").msgclass - ProductCatalogItem::PriceRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange").msgclass - ProductCatalogItem::StockState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState").enummodule - Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.Image").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb deleted file mode 100644 index 36f588521374..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/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/recommendationengine/v1beta1/catalog_pb' -require 'google/cloud/recommendationengine/v1beta1/import_pb' -require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n?google/cloud/recommendationengine/v1beta1/catalog_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a\x36google/cloud/recommendationengine/v1beta1/import.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb2\x01\n\x18\x43reateCatalogItemRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\"b\n\x15GetCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\"\xa4\x01\n\x17ListCatalogItemsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.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\"\x82\x01\n\x18ListCatalogItemsResponse\x12M\n\rcatalog_items\x18\x01 \x03(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe9\x01\n\x18UpdateCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"e\n\x18\x44\x65leteCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath2\x96\r\n\x0e\x43\x61talogService\x12\xfe\x01\n\x11\x43reateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"l\xda\x41\x13parent,catalog_item\x82\xd3\xe4\x93\x02P\"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:\x0c\x63\x61talog_item\x12\xdc\x01\n\x0eGetCatalogItem\x12@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\x12\xf5\x01\n\x10ListCatalogItems\x12\x42.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest\x1a\x43.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse\"X\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02\x42\x12@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems\x12\x89\x02\n\x11UpdateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"w\xda\x41\x1dname,catalog_item,update_mask\x82\xd3\xe4\x93\x02Q2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}:\x0c\x63\x61talog_item\x12\xc2\x01\n\x11\x44\x65leteCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest\x1a\x16.google.protobuf.Empty\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\x12\x81\x03\n\x12ImportCatalogItems\x12\x44.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest\x1a\x1d.google.longrunning.Operation\"\x85\x02\xca\x41\x80\x01\nDgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse\x12\x38google.cloud.recommendationengine.v1beta1.ImportMetadata\xda\x41,parent,request_id,input_config,errors_config\x82\xd3\xe4\x93\x02L\"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.CatalogItem", "google/cloud/recommendationengine/v1beta1/catalog.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 RecommendationEngine - module V1beta1 - CreateCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest").msgclass - GetCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest").msgclass - ListCatalogItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest").msgclass - ListCatalogItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse").msgclass - UpdateCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest").msgclass - DeleteCatalogItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb deleted file mode 100644 index 998d8ba8cbec..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/catalog_service_services_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recommendationengine/v1beta1/catalog_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/catalog_service_pb' - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module CatalogService - # Service for ingesting catalog 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.recommendationengine.v1beta1.CatalogService' - - # Creates a catalog item. - rpc :CreateCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem - # Gets a specific catalog item. - rpc :GetCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem - # Gets a list of catalog items. - rpc :ListCatalogItems, ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse - # Updates a catalog item. Partial updating is supported. Non-existing - # items will be created. - rpc :UpdateCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem - # Deletes a catalog item. - rpc :DeleteCatalogItem, ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, ::Google::Protobuf::Empty - # Bulk import of multiple catalog items. Request processing may be - # synchronous. No partial updating supported. Non-existing items will be - # created. - # - # Operation.response is of type ImportResponse. Note that it is - # possible for a subset of the items to be successfully updated. - rpc :ImportCatalogItems, ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb deleted file mode 100644 index e53451a89378..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/common.proto - -require 'google/protobuf' - - -descriptor_data = "\n6google/cloud/recommendationengine/v1beta1/common.proto\x12)google.cloud.recommendationengine.v1beta1\"\x96\x04\n\nFeatureMap\x12l\n\x14\x63\x61tegorical_features\x18\x01 \x03(\x0b\x32N.google.cloud.recommendationengine.v1beta1.FeatureMap.CategoricalFeaturesEntry\x12h\n\x12numerical_features\x18\x02 \x03(\x0b\x32L.google.cloud.recommendationengine.v1beta1.FeatureMap.NumericalFeaturesEntry\x1a\x1b\n\nStringList\x12\r\n\x05value\x18\x01 \x03(\t\x1a\x1a\n\tFloatList\x12\r\n\x05value\x18\x01 \x03(\x02\x1a|\n\x18\x43\x61tegoricalFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12O\n\x05value\x18\x02 \x01(\x0b\x32@.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList:\x02\x38\x01\x1ay\n\x16NumericalFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList:\x02\x38\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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 = [ - ] - 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 RecommendationEngine - module V1beta1 - FeatureMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap").msgclass - FeatureMap::StringList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap.StringList").msgclass - FeatureMap::FloatList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb deleted file mode 100644 index 14c719639702..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/import.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/recommendationengine/v1beta1/catalog_pb' -require 'google/cloud/recommendationengine/v1beta1/user_event_pb' -require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n6google/cloud/recommendationengine/v1beta1/import.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"$\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\"i\n\x13\x43\x61talogInlineSource\x12R\n\rcatalog_items\x18\x01 \x03(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x01\"g\n\x15UserEventInlineSource\x12N\n\x0buser_events\x18\x01 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x01\"9\n\x12ImportErrorsConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xa7\x02\n\x19ImportCatalogItemsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x0cinput_config\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.InputConfigB\x03\xe0\x41\x02\x12Y\n\rerrors_config\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigB\x03\xe0\x41\x01\"\xa8\x02\n\x17ImportUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x0cinput_config\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.InputConfigB\x03\xe0\x41\x02\x12Y\n\rerrors_config\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfigB\x03\xe0\x41\x01\"\xaa\x02\n\x0bInputConfig\x12_\n\x15\x63\x61talog_inline_source\x18\x01 \x01(\x0b\x32>.google.cloud.recommendationengine.v1beta1.CatalogInlineSourceH\x00\x12J\n\ngcs_source\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.GcsSourceH\x00\x12\x64\n\x18user_event_inline_source\x18\x03 \x01(\x0b\x32@.google.cloud.recommendationengine.v1beta1.UserEventInlineSourceH\x00\x42\x08\n\x06source\"\xcc\x01\n\x0eImportMetadata\x12\x16\n\x0eoperation_name\x18\x05 \x01(\t\x12\x12\n\nrequest_id\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x01 \x01(\x03\x12\x15\n\rfailure_count\x18\x02 \x01(\x03\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9d\x01\n\x1aImportCatalogItemsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12T\n\rerrors_config\x18\x02 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig\"\xf6\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12T\n\rerrors_config\x18\x02 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ImportErrorsConfig\x12Y\n\x0eimport_summary\x18\x03 \x01(\x0b\x32\x41.google.cloud.recommendationengine.v1beta1.UserEventImportSummary\"T\n\x16UserEventImportSummary\x12\x1b\n\x13joined_events_count\x18\x01 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x02 \x01(\x03\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.CatalogItem", "google/cloud/recommendationengine/v1beta1/catalog.proto"], - ["google.cloud.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/user_event.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 RecommendationEngine - module V1beta1 - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.GcsSource").msgclass - CatalogInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CatalogInlineSource").msgclass - UserEventInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEventInlineSource").msgclass - ImportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportErrorsConfig").msgclass - ImportCatalogItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest").msgclass - ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.InputConfig").msgclass - ImportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportMetadata").msgclass - ImportCatalogItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse").msgclass - ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse").msgclass - UserEventImportSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEventImportSummary").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb deleted file mode 100644 index 19d727b56e92..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_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/recommendationengine/v1beta1/prediction_apikey_registry_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/empty_pb' -require 'google/api/client_pb' -require 'google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb' - - -descriptor_data = "\nRgoogle/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/api/client.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\"/\n\x1cPredictionApiKeyRegistration\x12\x0f\n\x07\x61pi_key\x18\x01 \x01(\t\"\xea\x01\n)CreatePredictionApiKeyRegistrationRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12u\n\x1fprediction_api_key_registration\x18\x02 \x01(\x0b\x32G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationB\x03\xe0\x41\x02\"\xa3\x01\n(ListPredictionApiKeyRegistrationsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\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\"\xb7\x01\n)ListPredictionApiKeyRegistrationsResponse\x12q\n prediction_api_key_registrations\x18\x01 \x03(\x0b\x32G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x83\x01\n)DeletePredictionApiKeyRegistrationRequest\x12V\n\x04name\x18\x01 \x01(\tBH\xe0\x41\x02\xfa\x41\x42\n@recommendationengine.googleapis.com/PredictionApiKeyRegistration2\x97\x08\n\x18PredictionApiKeyRegistry\x12\xd9\x02\n\"CreatePredictionApiKeyRegistration\x12T.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest\x1aG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration\"\x93\x01\xda\x41&parent,prediction_api_key_registration\x82\xd3\xe4\x93\x02\x64\"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:\x01*\x12\xc0\x02\n!ListPredictionApiKeyRegistrations\x12S.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest\x1aT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations\x12\x82\x02\n\"DeletePredictionApiKeyRegistration\x12T.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest\x1a\x16.google.protobuf.Empty\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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 = [ - ] - 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 RecommendationEngine - module V1beta1 - PredictionApiKeyRegistration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration").msgclass - CreatePredictionApiKeyRegistrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest").msgclass - ListPredictionApiKeyRegistrationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest").msgclass - ListPredictionApiKeyRegistrationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse").msgclass - DeletePredictionApiKeyRegistrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb deleted file mode 100644 index a5afee34ea66..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/prediction_apikey_registry_service_pb' - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - module PredictionApiKeyRegistry - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' - - # Register an API key for use with predict method. - rpc :CreatePredictionApiKeyRegistration, ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration - # List the registered apiKeys for use with predict method. - rpc :ListPredictionApiKeyRegistrations, ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse - # Unregister an apiKey from using for predict method. - rpc :DeletePredictionApiKeyRegistration, ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb deleted file mode 100644 index 7f9d53765c4f..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/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/recommendationengine/v1beta1/prediction_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/recommendationengine/v1beta1/user_event_pb' -require 'google/protobuf/struct_pb' -require 'google/api/client_pb' - - -descriptor_data = "\nBgoogle/cloud/recommendationengine/v1beta1/prediction_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/api/client.proto\"\xae\x04\n\x0ePredictRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-recommendationengine.googleapis.com/Placement\x12M\n\nuser_event\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x64ry_run\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12Z\n\x06params\x18\x06 \x03(\x0b\x32\x45.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryB\x03\xe0\x41\x01\x12Z\n\x06labels\x18\t \x03(\x0b\x32\x45.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryB\x03\xe0\x41\x01\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\"\xe2\x04\n\x0fPredictResponse\x12\\\n\x07results\x18\x01 \x03(\x0b\x32K.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult\x12\x1c\n\x14recommendation_token\x18\x02 \x01(\t\x12 \n\x18items_missing_in_catalog\x18\x03 \x03(\t\x12\x0f\n\x07\x64ry_run\x18\x04 \x01(\x08\x12Z\n\x08metadata\x18\x05 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.PredictResponse.MetadataEntry\x12\x17\n\x0fnext_page_token\x18\x06 \x01(\t\x1a\xe1\x01\n\x10PredictionResult\x12\n\n\x02id\x18\x01 \x01(\t\x12t\n\ritem_metadata\x18\x02 \x03(\x0b\x32].google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.ItemMetadataEntry\x1aK\n\x11ItemMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\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\xe2\x02\n\x11PredictionService\x12\xf3\x01\n\x07Predict\x12\x39.google.cloud.recommendationengine.v1beta1.PredictRequest\x1a:.google.cloud.recommendationengine.v1beta1.PredictResponse\"q\xda\x41\x0fname,user_event\x82\xd3\xe4\x93\x02Y\"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/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 RecommendationEngine - module V1beta1 - PredictRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictRequest").msgclass - PredictResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictResponse").msgclass - PredictResponse::PredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb deleted file mode 100644 index 92327ca424a6..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/prediction_service_services_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recommendationengine/v1beta1/prediction_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/prediction_service_pb' - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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.recommendationengine.v1beta1.PredictionService' - - # Makes a recommendation prediction. If using API Key based authentication, - # the API Key must be registered using the - # [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] - # service. [Learn more](/recommendations-ai/docs/setting-up#register-key). - rpc :Predict, ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest, ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb deleted file mode 100644 index 00049d9e3c79..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\nNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x19google/api/resource.protoB\xac\x08\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::V1beta1\xea\x41i\n+recommendationengine.googleapis.com/Catalog\x12:projects/{project}/locations/{location}/catalogs/{catalog}\xea\x41\x92\x01\n3recommendationengine.googleapis.com/CatalogItemPath\x12[projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}\xea\x41\x86\x01\n.recommendationengine.googleapis.com/EventStore\x12Tprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}\xea\x41\xd9\x01\n@recommendationengine.googleapis.com/PredictionApiKeyRegistration\x12\x94\x01projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}\xea\x41\x9c\x01\n-recommendationengine.googleapis.com/Placement\x12kprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}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 RecommendationEngine - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb deleted file mode 100644 index 31d5869ee1c1..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/user_event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/recommendationengine/v1beta1/catalog_pb' -require 'google/cloud/recommendationengine/v1beta1/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n:google/cloud/recommendationengine/v1beta1/user_event.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a\x36google/cloud/recommendationengine/v1beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x92\x04\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\tuser_info\x18\x02 \x01(\x0b\x32\x33.google.cloud.recommendationengine.v1beta1.UserInfoB\x03\xe0\x41\x02\x12Q\n\x0c\x65vent_detail\x18\x03 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.EventDetailB\x03\xe0\x41\x01\x12`\n\x14product_event_detail\x18\x04 \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ProductEventDetailB\x03\xe0\x41\x01\x12\x33\n\nevent_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12[\n\x0c\x65vent_source\x18\x06 \x01(\x0e\x32@.google.cloud.recommendationengine.v1beta1.UserEvent.EventSourceB\x03\xe0\x41\x01\"X\n\x0b\x45ventSource\x12\x1c\n\x18\x45VENT_SOURCE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41UTOML\x10\x01\x12\r\n\tECOMMERCE\x10\x02\x12\x10\n\x0c\x42\x41TCH_UPLOAD\x10\x03\"\x8d\x01\n\x08UserInfo\x12\x17\n\nvisitor_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07user_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nip_address\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nuser_agent\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x64irect_user_request\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x01\n\x0b\x45ventDetail\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0creferrer_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpage_view_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65xperiment_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12!\n\x14recommendation_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12T\n\x10\x65vent_attributes\x18\x05 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\"\xea\x02\n\x12ProductEventDetail\x12\x14\n\x0csearch_query\x18\x01 \x01(\t\x12\x61\n\x0fpage_categories\x18\x02 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy\x12Q\n\x0fproduct_details\x18\x03 \x03(\x0b\x32\x38.google.cloud.recommendationengine.v1beta1.ProductDetail\x12\x0f\n\x07list_id\x18\x04 \x01(\t\x12\x14\n\x07\x63\x61rt_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x61\n\x14purchase_transaction\x18\x06 \x01(\x0b\x32>.google.cloud.recommendationengine.v1beta1.PurchaseTransactionB\x03\xe0\x41\x01\"\xf2\x02\n\x13PurchaseTransaction\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07revenue\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x12]\n\x05taxes\x18\x03 \x03(\x0b\x32I.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.TaxesEntryB\x03\xe0\x41\x01\x12]\n\x05\x63osts\x18\x04 \x03(\x0b\x32I.google.cloud.recommendationengine.v1beta1.PurchaseTransaction.CostsEntryB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x06 \x01(\tB\x03\xe0\x41\x02\x1a,\n\nTaxesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1a,\n\nCostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\"\xe6\x02\n\rProductDetail\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcurrency_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0eoriginal_price\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01\x12\x1a\n\rdisplay_price\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01\x12\x62\n\x0bstock_state\x18\x05 \x01(\x0e\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockStateB\x03\xe0\x41\x01\x12\x15\n\x08quantity\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x61vailable_quantity\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x0fitem_attributes\x18\x08 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.FeatureMap", "google/cloud/recommendationengine/v1beta1/common.proto"], - ["google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy", "google/cloud/recommendationengine/v1beta1/catalog.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 RecommendationEngine - module V1beta1 - UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEvent").msgclass - UserEvent::EventSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserEvent.EventSource").enummodule - UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.UserInfo").msgclass - EventDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.EventDetail").msgclass - ProductEventDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductEventDetail").msgclass - PurchaseTransaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurchaseTransaction").msgclass - ProductDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ProductDetail").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb deleted file mode 100644 index a0a2f6643207..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommendationengine/v1beta1/user_event_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/field_behavior_pb' -require 'google/api/httpbody_pb' -require 'google/api/resource_pb' -require 'google/cloud/recommendationengine/v1beta1/import_pb' -require 'google/cloud/recommendationengine/v1beta1/user_event_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' -require 'google/api/client_pb' - - -descriptor_data = "\nBgoogle/cloud/recommendationengine/v1beta1/user_event_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/recommendationengine/v1beta1/import.proto\x1a:google/cloud/recommendationengine/v1beta1/user_event.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/api/client.proto\"\x89\x01\n\x16PurgeUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x17PurgeUserEventsMetadata\x12\x16\n\x0eoperation_name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x88\x01\n\x17PurgeUserEventsResponse\x12\x1b\n\x13purged_events_count\x18\x01 \x01(\x03\x12P\n\x12user_events_sample\x18\x02 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEvent\"\xae\x01\n\x15WriteUserEventRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12M\n\nuser_event\x18\x02 \x01(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEventB\x03\xe0\x41\x02\"\x9e\x01\n\x17\x43ollectUserEventRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03\x65ts\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\"\xa5\x01\n\x15ListUserEventsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.recommendationengine.googleapis.com/EventStore\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\"|\n\x16ListUserEventsResponse\x12I\n\x0buser_events\x18\x01 \x03(\x0b\x32\x34.google.cloud.recommendationengine.v1beta1.UserEvent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd8\x0c\n\x10UserEventService\x12\x84\x02\n\x0eWriteUserEvent\x12@.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest\x1a\x34.google.cloud.recommendationengine.v1beta1.UserEvent\"z\xda\x41\x11parent,user_event\x82\xd3\xe4\x93\x02`\"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write:\nuser_event\x12\xe6\x01\n\x10\x43ollectUserEvent\x12\x42.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"x\xda\x41\x19parent,user_event,uri,ets\x82\xd3\xe4\x93\x02V\x12T/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect\x12\xfb\x01\n\x0eListUserEvents\x12@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest\x1a\x41.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse\"d\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02N\x12L/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents\x12\xf3\x02\n\x0fPurgeUserEvents\x12\x41.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xfd\x01\xca\x41\x86\x01\nAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse\x12\x41google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata\xda\x41\x13parent,filter,force\x82\xd3\xe4\x93\x02W\"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:\x01*\x12\x86\x03\n\x10ImportUserEvents\x12\x42.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x02\xca\x41~\nBgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse\x12\x38google.cloud.recommendationengine.v1beta1.ImportMetadata\xda\x41,parent,request_id,input_config,errors_config\x82\xd3\xe4\x93\x02X\"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:\x01*\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::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.recommendationengine.v1beta1.UserEvent", "google/cloud/recommendationengine/v1beta1/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 RecommendationEngine - module V1beta1 - PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest").msgclass - PurgeUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata").msgclass - PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse").msgclass - WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.WriteUserEventRequest").msgclass - CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.CollectUserEventRequest").msgclass - ListUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListUserEventsRequest").msgclass - ListUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommendationengine.v1beta1.ListUserEventsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb deleted file mode 100644 index c8f9605da343..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recommendationengine/v1beta1/user_event_service.proto for package 'Google.Cloud.RecommendationEngine.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/recommendationengine/v1beta1/user_event_service_pb' - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - 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.recommendationengine.v1beta1.UserEventService' - - # Writes a single user event. - rpc :WriteUserEvent, ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest, ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent - # Writes a single user event from the browser. This uses a GET request to - # due to browser restriction of POST-ing to a 3rd party domain. - # - # This method is used only by the Recommendations AI JavaScript pixel. - # Users should not call this method directly. - rpc :CollectUserEvent, ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest, ::Google::Api::HttpBody - # Gets a list of user events within a time range, with potential filtering. - rpc :ListUserEvents, ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse - # 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::ImportUserEventsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md deleted file mode 100644 index cf12167c2a75..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Recommendations AI 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-recommendation_engine-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/httpbody.rb deleted file mode 100644 index 938f7ac6b2fd..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb deleted file mode 100644 index f3ea16e814c2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb +++ /dev/null @@ -1,218 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # CatalogItem captures all metadata information of items to be recommended. - # @!attribute [rw] id - # @return [::String] - # Required. Catalog item identifier. UTF-8 encoded string with a length limit - # of 128 bytes. - # - # This id must be unique among all catalog items within the same catalog. It - # should also be used when logging user events in order for the user events - # to be joined with the Catalog. - # @!attribute [rw] category_hierarchies - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem::CategoryHierarchy>] - # Required. Catalog item categories. This field is repeated for supporting - # one catalog item belonging to several parallel category hierarchies. - # - # For example, if a shoes product belongs to both - # ["Shoes & Accessories" -> "Shoes"] and - # ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - # represented as: - # - # "categoryHierarchies": [ - # { "categories": ["Shoes & Accessories", "Shoes"]}, - # { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } - # ] - # @!attribute [rw] title - # @return [::String] - # Required. Catalog item title. UTF-8 encoded string with a length limit of 1 - # KiB. - # @!attribute [rw] description - # @return [::String] - # Optional. Catalog item description. UTF-8 encoded string with a length - # limit of 5 KiB. - # @!attribute [rw] item_attributes - # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] - # Optional. Highly encouraged. Extra catalog item attributes to be - # included in the recommendation model. For example, for retail 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 item attributes here. - # @!attribute [rw] language_code - # @return [::String] - # Optional. Language of the title/description/item_attributes. Use language - # tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our - # supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', - # 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact - # your Google account manager. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Optional. Filtering tags associated with the catalog item. Each tag should - # be a UTF-8 encoded string with a length limit of 1 KiB. - # - # This tag can be used for filtering recommendation results by passing the - # tag as part of the predict request filter. - # @!attribute [rw] item_group_id - # @return [::String] - # Optional. Variant group identifier for prediction results. UTF-8 encoded - # string with a length limit of 128 bytes. - # - # This field must be enabled before it can be used. [Learn - # more](/recommendations-ai/docs/catalog#item-group-id). - # @!attribute [rw] product_metadata - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem] - # Optional. Metadata specific to retail products. - class CatalogItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Category represents catalog item category hierarchy. - # @!attribute [rw] categories - # @return [::Array<::String>] - # Required. Catalog item categories. Each category should be a UTF-8 - # encoded string with a length limit of 2 KiB. - # - # Note that the order in the list denotes the specificity (from least to - # most specific). - class CategoryHierarchy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # ProductCatalogItem captures item metadata specific to retail products. - # @!attribute [rw] exact_price - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::ExactPrice] - # Optional. The exact product price. - # - # Note: The following fields are mutually exclusive: `exact_price`, `price_range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] price_range - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::PriceRange] - # Optional. The product price range. - # - # Note: The following fields are mutually exclusive: `price_range`, `exact_price`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] costs - # @return [::Google::Protobuf::Map{::String => ::Float}] - # Optional. A map to pass the costs associated with the product. - # - # For example: - # \\{"manufacturing": 45.5} The profit of selling this item is computed like - # so: - # - # * If 'exactPrice' is provided, profit = displayPrice - sum(costs) - # * If 'priceRange' is provided, profit = minPrice - sum(costs) - # @!attribute [rw] currency_code - # @return [::String] - # Optional. Only required if the price is set. Currency code for price/costs. Use - # three-character ISO-4217 code. - # @!attribute [rw] stock_state - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState] - # Optional. Online stock state of the catalog item. Default is `IN_STOCK`. - # @!attribute [rw] available_quantity - # @return [::Integer] - # Optional. The available quantity of the item. - # @!attribute [rw] canonical_product_uri - # @return [::String] - # Optional. Canonical URL directly linking to the item detail page with a - # length limit of 5 KiB.. - # @!attribute [rw] images - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::Image>] - # Optional. Product images for the catalog item. - class ProductCatalogItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Exact product price. - # @!attribute [rw] display_price - # @return [::Float] - # Optional. Display price of the product. - # @!attribute [rw] original_price - # @return [::Float] - # Optional. Price of the product without any discount. If zero, by default - # set to be the 'displayPrice'. - class ExactPrice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Product price range when there are a range of prices for different - # variations of the same product. - # @!attribute [rw] min - # @return [::Float] - # Required. The minimum product price. - # @!attribute [rw] max - # @return [::Float] - # Required. The maximum product price. - class PriceRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class CostsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Item stock state. If this field is unspecified, the item is - # assumed to be in stock. - module StockState - # Default item stock status. Should never be used. - STOCK_STATE_UNSPECIFIED = 0 - - # Item in stock. - IN_STOCK = 0 - - # Item out of stock. - OUT_OF_STOCK = 1 - - # Item that is in pre-order state. - PREORDER = 2 - - # Item that is back-ordered (i.e. temporarily out of stock). - BACKORDER = 3 - end - end - - # Catalog item thumbnail/detail image. - # @!attribute [rw] uri - # @return [::String] - # Required. URL of the image with a length limit of 5 KiB. - # @!attribute [rw] height - # @return [::Integer] - # Optional. Height of the image in number of pixels. - # @!attribute [rw] width - # @return [::Integer] - # Optional. Width of the image in number of pixels. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb deleted file mode 100644 index 21e34edb82fc..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # Request message for CreateCatalogItem method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @!attribute [rw] catalog_item - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # Required. The catalog item to create. - class CreateCatalogItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetCatalogItem method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - class GetCatalogItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListCatalogItems method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent catalog resource name, such as - # `projects/*/locations/global/catalogs/default_catalog`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The previous ListCatalogItemsResponse.next_page_token. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter to apply on the list results. - class ListCatalogItemsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListCatalogItems method. - # @!attribute [rw] catalog_items - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # The catalog items. - # @!attribute [rw] next_page_token - # @return [::String] - # If empty, the list is complete. If nonempty, the token to pass to the next - # request's ListCatalogItemRequest.page_token. - class ListCatalogItemsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateCatalogItem method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - # @!attribute [rw] catalog_item - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem] - # Required. The catalog item to update/create. The 'catalog_item_id' field - # has to match that in the 'name'. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Indicates which fields in the provided 'item' to update. If not - # set, will by default update all fields. - class UpdateCatalogItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteCatalogItem method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of catalog item, such as - # `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - class DeleteCatalogItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb deleted file mode 100644 index 0e2cc12edef0..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/common.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # FeatureMap represents extra features that customers want to include in the - # recommendation model for catalogs/user events as categorical/numerical - # features. - # @!attribute [rw] categorical_features - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::StringList}] - # Categorical features that can take on one of a limited number of possible - # values. Some examples would be the brand/maker of a product, or country of - # a customer. - # - # Feature names and values must be UTF-8 encoded strings. - # - # For example: `{ "colors": {"value": ["yellow", "green"]}, - # "sizes": \\{"value":["S", "M"]}` - # @!attribute [rw] numerical_features - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::FloatList}] - # Numerical features. Some examples would be the height/weight of a product, - # or age of a customer. - # - # Feature names must be UTF-8 encoded strings. - # - # For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, - # "heights_cm": \\{"value":[8.1, 6.4]} }` - class FeatureMap - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A list of string features. - # @!attribute [rw] value - # @return [::Array<::String>] - # String feature value with a length limit of 128 bytes. - class StringList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of float features. - # @!attribute [rw] value - # @return [::Array<::Float>] - # Float feature value. - class FloatList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::StringList] - class CategoricalFeaturesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap::FloatList] - class NumericalFeaturesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb deleted file mode 100644 index 612e5cbdaa66..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/import.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # Google Cloud Storage location for input content. - # format. - # @!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 catalog information](/recommendations-ai/docs/upload-catalog) - # for the expected file format and setup instructions. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The inline source for the input config for ImportCatalogItems method. - # @!attribute [rw] catalog_items - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem>] - # Optional. A list of catalog items to update/create. Recommended max of 10k - # items. - class CatalogInlineSource - 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::RecommendationEngine::V1beta1::UserEvent>] - # Optional. 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 path for import errors. This must be an empty, - # existing Cloud Storage bucket. Import errors will be written to a file in - # this bucket, 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` - # @!attribute [rw] request_id - # @return [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency and used for request deduplication. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. - # @!attribute [rw] input_config - # @return [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig] - # Required. The desired input location of the data. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig] - # Optional. The desired location of errors incurred during the Import. - class ImportCatalogItemsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the ImportUserEvents request. - # @!attribute [rw] parent - # @return [::String] - # Required. - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - # @!attribute [rw] request_id - # @return [::String] - # Optional. Unique identifier provided by client, within the ancestor - # dataset scope. Ensures idempotency for expensive long running operations. - # Server-generated if unspecified. Up to 128 characters long. This is - # returned as google.longrunning.Operation.name in the response. Note that - # this field must not be set if the desired input config is - # catalog_inline_source. - # @!attribute [rw] input_config - # @return [::Google::Cloud::RecommendationEngine::V1beta1::InputConfig] - # Required. The desired input location of the data. - # @!attribute [rw] errors_config - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig] - # Optional. The desired location of errors incurred during the Import. - class ImportUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input config source. - # @!attribute [rw] catalog_inline_source - # @return [::Google::Cloud::RecommendationEngine::V1beta1::CatalogInlineSource] - # The Inline source for the input content for Catalog items. - # - # Note: The following fields are mutually exclusive: `catalog_inline_source`, `gcs_source`, `user_event_inline_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::RecommendationEngine::V1beta1::GcsSource] - # Google Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `catalog_inline_source`, `user_event_inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_event_inline_source - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEventInlineSource] - # The Inline source for the input content for UserEvents. - # - # Note: The following fields are mutually exclusive: `user_event_inline_source`, `catalog_inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the Import operation. This will be - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] operation_name - # @return [::String] - # Name of the operation. - # @!attribute [rw] request_id - # @return [::String] - # Id of the request / operation. This is parroting back the requestId that - # was passed in the request. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create 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] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class ImportMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the ImportCatalogItemsRequest. 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::RecommendationEngine::V1beta1::ImportErrorsConfig] - # Echoes the destination for the complete errors in the request if set. - class ImportCatalogItemsResponse - 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::RecommendationEngine::V1beta1::ImportErrorsConfig] - # Echoes the destination for the complete errors if this field was set in - # the request. - # @!attribute [rw] import_summary - # @return [::Google::Cloud::RecommendationEngine::V1beta1::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 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb deleted file mode 100644 index 9947c1867d66..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # Registered Api Key. - # @!attribute [rw] api_key - # @return [::String] - # The API key. - class PredictionApiKeyRegistration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreatePredictionApiKeyRegistration` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @!attribute [rw] prediction_api_key_registration - # @return [::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration] - # Required. The prediction API key registration. - class CreatePredictionApiKeyRegistrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListPredictionApiKeyRegistrations`. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent placement resource name such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return per page. If unset, the - # service will choose a reasonable default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - class ListPredictionApiKeyRegistrationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListPredictionApiKeyRegistrations`. - # @!attribute [rw] prediction_api_key_registrations - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration>] - # The list of registered API keys. - # @!attribute [rw] next_page_token - # @return [::String] - # If empty, the list is complete. If nonempty, pass the token to the next - # request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. - class ListPredictionApiKeyRegistrationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `DeletePredictionApiKeyRegistration` method. - # @!attribute [rw] name - # @return [::String] - # Required. The API key to unregister including full resource path. - # `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - class DeletePredictionApiKeyRegistrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb deleted file mode 100644 index dfbb8aab0ce7..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/prediction_service.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # Request message for Predict method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of the format: - # `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - # The id of the recommendation engine placement. This id is used to identify - # the set of models that will be used to make the prediction. - # - # We currently support three placements with the following IDs by default: - # - # * `shopping_cart`: Predicts items frequently bought together with one or - # more catalog items in the same shopping session. Commonly displayed after - # `add-to-cart` events, on product detail pages, or on the shopping cart - # page. - # - # * `home_page`: Predicts the next product that a user will most likely - # engage with or purchase based on the shopping or viewing history of the - # specified `userId` or `visitorId`. For example - Recommendations for you. - # - # * `product_detail`: Predicts the next product that a user will most likely - # engage with or purchase. The prediction is based on the shopping or - # viewing history of the specified `userId` or `visitorId` and its - # relevance to a specified `CatalogItem`. Typically used on product detail - # pages. For example - More items like this. - # - # * `recently_viewed_default`: Returns up to 75 items recently viewed by the - # specified `userId` or `visitorId`, most recent ones first. Returns - # nothing if neither of them has viewed any items yet. For example - - # Recently viewed. - # - # The full list of available placements can be seen at - # https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - # @!attribute [rw] user_event - # @return [::Google::Cloud::RecommendationEngine::V1beta1::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. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return per page. Set this property - # to the number of prediction results required. If zero, the service will - # choose a reasonable default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The previous PredictResponse.next_page_token. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter for restricting prediction results. Accepts values for - # tags and the `filterOutOfStockItems` flag. - # - # * Tag expressions. Restricts predictions to items 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 KiB. - # - # * filterOutOfStockItems. Restricts predictions to items 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 - # @!attribute [rw] dry_run - # @return [::Boolean] - # Optional. Use dryRun mode for this prediction query. If set to true, a - # dummy model will be used that returns arbitrary catalog items. - # Note that the dryRun 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}] - # Optional. Additional domain specific parameters for the predictions. - # - # Allowed values: - # - # * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - # object will be returned in the - # `PredictResponse.PredictionResult.itemMetadata` object in the method - # response. - # * `returnItemScore`: Boolean. If set to true, the prediction 'score' - # corresponding to each returned item will be set in the `metadata` - # field in the prediction response. The given 'score' indicates the - # probability of an item being clicked/purchased given the user's context - # and history. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels for the predict request. - # - # * Label keys can contain lowercase letters, digits and hyphens, must start - # with a letter, and must end with a letter or digit. - # * Non-zero label values can contain lowercase letters, digits and hyphens, - # must start with a letter, and must end with a letter or digit. - # * No more than 64 labels can be associated with a given request. - # - # See https://goo.gl/xmQnxf for more information on and examples of labels. - 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::RecommendationEngine::V1beta1::PredictResponse::PredictionResult>] - # A list of recommended items. The order represents the ranking (from the - # most relevant item to the least). - # @!attribute [rw] recommendation_token - # @return [::String] - # A unique recommendation token. This should be included in the user event - # logs resulting from this recommendation, which enables accurate attribution - # of recommendation model performance. - # @!attribute [rw] items_missing_in_catalog - # @return [::Array<::String>] - # IDs of items in the request that were missing from the catalog. - # @!attribute [rw] dry_run - # @return [::Boolean] - # True if the dryRun property was set in the request. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional domain specific prediction response metadata. - # @!attribute [rw] next_page_token - # @return [::String] - # If empty, the list is complete. If nonempty, the token to pass to the next - # request's PredictRequest.page_token. - 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 catalog item - # @!attribute [rw] item_metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional item metadata / annotations. - # - # Possible values: - # - # * `catalogItem`: JSON representation of the catalogItem. Will be set if - # `returnCatalogItem` is set to true in `PredictRequest.params`. - # * `score`: Prediction score in double value. Will be set if - # `returnItemScore` 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 ItemMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!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 diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb deleted file mode 100644 index 7f8027593df7..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event.rb +++ /dev/null @@ -1,367 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # UserEvent captures all metadata information recommendation engine 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. - # * `add-to-list` Items being added to a list (shopping list, favorites - # etc). - # * `category-page-view` Special pages such as sale or promotion pages - # viewed. - # * `checkout-start` User starting a checkout process. - # * `detail-page-view` Products detail page viewed. - # * `home-page-view` Homepage viewed. - # * `page-visit` Generic page visits not included in the event types above. - # * `purchase-complete` User finishing a purchase. - # * `refund` Purchased items being refunded or returned. - # * `remove-from-cart` Products being removed from cart. - # * `remove-from-list` Items being removed from a list. - # * `search` Product search. - # * `shopping-cart-page-view` User viewing a shopping cart. - # * `impression` List of items displayed. Used by Google Tag Manager. - # @!attribute [rw] user_info - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserInfo] - # Required. User information. - # @!attribute [rw] event_detail - # @return [::Google::Cloud::RecommendationEngine::V1beta1::EventDetail] - # Optional. User event detailed information common across different - # recommendation types. - # @!attribute [rw] product_event_detail - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductEventDetail] - # Optional. Retail product specific user event metadata. - # - # This field is required for the following event types: - # - # * `add-to-cart` - # * `add-to-list` - # * `category-page-view` - # * `checkout-start` - # * `detail-page-view` - # * `purchase-complete` - # * `refund` - # * `remove-from-cart` - # * `remove-from-list` - # * `search` - # - # This field is optional for the following event types: - # - # * `page-visit` - # * `shopping-cart-page-view` - note that 'product_event_detail' should be - # set for this unless the shopping cart is empty. - # - # This field is not allowed for the following event types: - # - # * `home-page-view` - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Only required for ImportUserEvents method. Timestamp of user - # event created. - # @!attribute [rw] event_source - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent::EventSource] - # Optional. This field should *not* be set when using JavaScript pixel - # or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. - class UserEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # User event source. - module EventSource - # Unspecified event source. - EVENT_SOURCE_UNSPECIFIED = 0 - - # The event is ingested via a javascript pixel or Recommendations AI Tag - # through automl datalayer or JS Macros. - AUTOML = 1 - - # The event is ingested via Recommendations AI Tag through Enhanced - # Ecommerce datalayer. - ECOMMERCE = 2 - - # The event is ingested via Import user events API. - BATCH_UPLOAD = 3 - end - end - - # Information of end users. - # @!attribute [rw] visitor_id - # @return [::String] - # Required. A unique identifier for tracking visitors with a length limit of - # 128 bytes. - # - # For example, this could be implemented with a 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. - # Maximum length 128 bytes. Cannot be empty. - # @!attribute [rw] user_id - # @return [::String] - # Optional. Unique identifier for logged-in user with a length limit of 128 - # bytes. Required only for logged-in users. - # @!attribute [rw] ip_address - # @return [::String] - # Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or - # IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be - # set when using the javascript pixel or if `direct_user_request` is set. - # Used to extract location information for personalization. - # @!attribute [rw] user_agent - # @return [::String] - # Optional. User agent as included in the HTTP header. UTF-8 encoded string - # with a length limit of 1 KiB. - # - # This should *not* be set when using the JavaScript pixel or if - # `directUserRequest` is set. - # @!attribute [rw] direct_user_request - # @return [::Boolean] - # Optional. Indicates if the request is made directly from the end user - # in which case the user_agent and ip_address fields can be populated - # from the HTTP request. This should *not* be set when using the javascript - # pixel. 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). - class UserInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # User event details shared by all recommendation types. - # @!attribute [rw] uri - # @return [::String] - # Optional. Complete url (window.location.href) of the user's current page. - # When using the JavaScript pixel, this value is filled in automatically. - # Maximum length 5KB. - # @!attribute [rw] referrer_uri - # @return [::String] - # Optional. The referrer url of the current page. When using - # the JavaScript pixel, this value is filled in automatically. - # @!attribute [rw] page_view_id - # @return [::String] - # Optional. 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. This `pageViewId` will be - # automatically generated if using the JavaScript pixel. - # @!attribute [rw] experiment_ids - # @return [::Array<::String>] - # Optional. 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 Recommendation - # Engine system, using different recommendation models). - # @!attribute [rw] recommendation_token - # @return [::String] - # Optional. Recommendation token included in the recommendation prediction - # response. - # - # This field enables accurate attribution of recommendation model - # performance. - # - # This token enables us to accurately attribute page view or purchase back to - # the event and the particular predict response containing this - # clicked/purchased item. If user clicks on product K in the recommendation - # results, pass the `PredictResponse.recommendationToken` property as a url - # parameter to product K's page. When recording events on product K's page, - # log the PredictResponse.recommendation_token to this field. - # - # Optional, but highly encouraged for user events that are the result of a - # recommendation prediction query. - # @!attribute [rw] event_attributes - # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] - # Optional. Extra user event features to include in the recommendation - # model. - # - # For product recommendation, an example of extra user information is - # traffic_channel, i.e. how user arrives at the site. Users can arrive - # at the site by coming to the site directly, or coming through Google - # search, and etc. - class EventDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ProductEventDetail captures user event information specific to retail - # products. - # @!attribute [rw] search_query - # @return [::String] - # Required for `search` events. Other event types should not set this field. - # The user's search query as UTF-8 encoded text with a length limit of 5 KiB. - # @!attribute [rw] page_categories - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem::CategoryHierarchy>] - # Required for `category-page-view` events. Other event types should not set - # this field. - # The categories associated with a category page. - # Category pages include special pages such as sales or promotions. For - # instance, a special sale page may have the category hierarchy: - # categories : ["Sales", "2017 Black Friday Deals"]. - # @!attribute [rw] product_details - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::ProductDetail>] - # The main product details related to the event. - # - # This field is required for the following event types: - # - # * `add-to-cart` - # * `add-to-list` - # * `checkout-start` - # * `detail-page-view` - # * `purchase-complete` - # * `refund` - # * `remove-from-cart` - # * `remove-from-list` - # - # This field is optional for the following event types: - # - # * `page-visit` - # * `shopping-cart-page-view` - note that 'product_details' should be set for - # this unless the shopping cart is empty. - # - # This field is not allowed for the following event types: - # - # * `category-page-view` - # * `home-page-view` - # * `search` - # @!attribute [rw] list_id - # @return [::String] - # Required for `add-to-list` and `remove-from-list` events. The id or name of - # the list that the item is being added to or removed from. Other event types - # should not set this field. - # @!attribute [rw] cart_id - # @return [::String] - # Optional. 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`, `remove-from-cart`, - # `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. - # @!attribute [rw] purchase_transaction - # @return [::Google::Cloud::RecommendationEngine::V1beta1::PurchaseTransaction] - # Optional. A transaction represents the entire purchase transaction. - # Required for `purchase-complete` events. Optional for `checkout-start` - # events. Other event types should not set this field. - class ProductEventDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transaction represents the entire purchase transaction. - # @!attribute [rw] id - # @return [::String] - # Optional. The transaction ID with a length limit of 128 bytes. - # @!attribute [rw] revenue - # @return [::Float] - # Required. Total 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. This field - # is not required if the event type is `refund`. - # @!attribute [rw] taxes - # @return [::Google::Protobuf::Map{::String => ::Float}] - # Optional. All the taxes associated with the transaction. - # @!attribute [rw] costs - # @return [::Google::Protobuf::Map{::String => ::Float}] - # Optional. All the costs associated with the product. These can be - # manufacturing costs, shipping expenses not borne by the end user, or any - # other costs. - # - # Total product cost such that - # profit = revenue - (sum(taxes) + sum(costs)) - # If product_cost is not set, then - # profit = revenue - tax - shipping - sum(CatalogItem.costs). - # - # If CatalogItem.cost is not specified for one of the items, CatalogItem.cost - # based profit *cannot* be calculated for this Transaction. - # @!attribute [rw] currency_code - # @return [::String] - # Required. Currency code. Use three-character ISO-4217 code. This field - # is not required if the event type is `refund`. - class PurchaseTransaction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class TaxesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class CostsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Detailed product information associated with a user event. - # @!attribute [rw] id - # @return [::String] - # Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 - # characters. - # @!attribute [rw] currency_code - # @return [::String] - # Optional. Currency code for price/costs. Use three-character ISO-4217 - # code. Required only if originalPrice or displayPrice is set. - # @!attribute [rw] original_price - # @return [::Float] - # Optional. Original price of the product. If provided, this will override - # the original price in Catalog for this product. - # @!attribute [rw] display_price - # @return [::Float] - # Optional. Display price of the product (e.g. discounted price). If - # provided, this will override the display price in Catalog for this product. - # @!attribute [rw] stock_state - # @return [::Google::Cloud::RecommendationEngine::V1beta1::ProductCatalogItem::StockState] - # Optional. Item stock state. If provided, this overrides the stock state - # in Catalog for items in this event. - # @!attribute [rw] quantity - # @return [::Integer] - # Optional. 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 `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, - # `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event - # types. - # @!attribute [rw] available_quantity - # @return [::Integer] - # Optional. Quantity of the products in stock when a user event happens. - # Optional. If provided, this overrides the available quantity in Catalog for - # this event. and can only be set if `stock_status` is set to `IN_STOCK`. - # - # Note that if an item is out of stock, you must set the `stock_state` field - # to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not - # sufficient to mark the item out of stock. - # @!attribute [rw] item_attributes - # @return [::Google::Cloud::RecommendationEngine::V1beta1::FeatureMap] - # Optional. Extra features associated with a product in the user event. - class ProductDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb deleted file mode 100644 index 4d90fede9bc5..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/cloud/recommendationengine/v1beta1/user_event_service.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module RecommendationEngine - module V1beta1 - # Request message for PurgeUserEvents method. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the event_store under which the events are - # created. The format is - # `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string to specify the events to be deleted. Empty - # string filter is not allowed. This filter can also be used with - # ListUserEvents API to list events that will be deleted. The eligible fields - # for filtering are: - # * eventType - UserEvent.eventType field of type string. - # * eventTime - in ISO 8601 "zulu" format. - # * visitorId - field of type string. Specifying this will delete all events - # associated with a visitor. - # * userId - field of type string. Specifying this will delete all events - # associated with a user. - # Example 1: Deleting all events in a time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - # "2012-04-23T18:30:43.511Z"` - # Example 2: Deleting specific eventType in time range. - # `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - # Example 3: Deleting all events for a specific visitor - # `visitorId = visitor1024` - # The filtering fields are assumed to have an implicit AND. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. The default value is false. Override this flag to true to - # actually perform the purge. If the field is not set to true, a sampling of - # events to be deleted will be returned. - class PurgeUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeUserEvents operation. - # This will be returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] operation_name - # @return [::String] - # The ID of the request / operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - class PurgeUserEventsMetadata - 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. - # @!attribute [rw] user_events_sample - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # A sampling of events deleted (or will be deleted) depending on the `force` - # property in the request. Max of 500 items will be returned. - class PurgeUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for WriteUserEvent method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent eventStore resource name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @!attribute [rw] user_event - # @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent] - # Required. User event to write. - class WriteUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CollectUserEvent method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent eventStore name, such as - # `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - # @!attribute [rw] user_event - # @return [::String] - # Required. URL encoded UserEvent proto. - # @!attribute [rw] uri - # @return [::String] - # Optional. The url including cgi-parameters but excluding the hash fragment. - # The URL must be truncated to 1.5K bytes to conservatively be under the 2K - # bytes. 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] - # Optional. The event timestamp in milliseconds. This prevents browser - # caching of otherwise identical get requests. The name is abbreviated to - # reduce the payload bytes. - class CollectUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListUserEvents method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent eventStore resource name, such as - # `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return per page. If zero, the - # service will choose a reasonable default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The previous ListUserEventsResponse.next_page_token. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering expression to specify restrictions over - # returned events. This is a sequence of terms, where each term applies some - # kind of a restriction to the returned user events. Use this expression to - # restrict results to a specific time range, or filter events by eventType. - # eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - # eventTime<"2012-04-23T18:25:43.511Z" eventType=search - # - # We expect only 3 types of fields: - # - # * eventTime: this can be specified a maximum of 2 times, once with a - # less than operator and once with a greater than operator. The - # eventTime restrict should result in one contiguous valid eventTime - # range. - # - # * eventType: only 1 eventType restriction can be specified. - # - # * eventsMissingCatalogItems: specififying this will restrict results - # to events for which catalog items were not found in the catalog. The - # default behavior is to return only those events for which catalog - # items were found. - # - # Some examples of valid filters expressions: - # - # * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" - # * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - # eventType = detail-page-view - # * Example 3: eventsMissingCatalogItems - # eventType = search eventTime < "2018-04-23T18:30:43.511Z" - # * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - # * Example 5: eventType = search - # * Example 6: eventsMissingCatalogItems - class ListUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListUserEvents method. - # @!attribute [rw] user_events - # @return [::Array<::Google::Cloud::RecommendationEngine::V1beta1::UserEvent>] - # The user events. - # @!attribute [rw] next_page_token - # @return [::String] - # If empty, the list is complete. If nonempty, the token to pass to the next - # request's ListUserEvents.page_token. - class ListUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile deleted file mode 100644 index 6c9d6704e9f3..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine-v1beta1", path: "../" -else - gem "google-cloud-recommendation_engine-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-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb deleted file mode 100644 index 46494eab013d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the create_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item. -# -def create_catalog_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new - - # Call the create_catalog_item method. - result = client.create_catalog_item request - - # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - p result -end -# [END recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb deleted file mode 100644 index 775ced7d5951..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the delete_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item. -# -def delete_catalog_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new - - # Call the delete_catalog_item method. - result = client.delete_catalog_item request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb deleted file mode 100644 index 98f413ad6392..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the get_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item. -# -def get_catalog_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new - - # Call the get_catalog_item method. - result = client.get_catalog_item request - - # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - p result -end -# [END recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb deleted file mode 100644 index 4ba07a7b81e6..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.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 recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the import_catalog_items 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::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items. -# -def import_catalog_items - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new - - # Call the import_catalog_items method. - result = client.import_catalog_items request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb deleted file mode 100644 index bf9bdcc0bb46..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.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 recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the list_catalog_items 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::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items. -# -def list_catalog_items - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new - - # Call the list_catalog_items method. - result = client.list_catalog_items request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - p item - end -end -# [END recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb deleted file mode 100644 index e23bd345d17c..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the update_catalog_item 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::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item. -# -def update_catalog_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new - - # Call the update_catalog_item method. - result = client.update_catalog_item request - - # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - p result -end -# [END recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb deleted file mode 100644 index 0570218a7357..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the create_prediction_api_key_registration call in the PredictionApiKeyRegistry service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration. -# -def create_prediction_api_key_registration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new - - # Call the create_prediction_api_key_registration method. - result = client.create_prediction_api_key_registration request - - # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - p result -end -# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb deleted file mode 100644 index 3c5a1e2c1ca6..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the delete_prediction_api_key_registration call in the PredictionApiKeyRegistry service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration. -# -def delete_prediction_api_key_registration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new - - # Call the delete_prediction_api_key_registration method. - result = client.delete_prediction_api_key_registration request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb deleted file mode 100644 index 51c83a42921d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.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 recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the list_prediction_api_key_registrations call in the PredictionApiKeyRegistry service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations. -# -def list_prediction_api_key_registrations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new - - # Call the list_prediction_api_key_registrations method. - result = client.list_prediction_api_key_registrations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - p item - end -end -# [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb deleted file mode 100644 index d06c9e4b0867..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.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 recommendationengine_v1beta1_generated_PredictionService_Predict_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# 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::RecommendationEngine::V1beta1::PredictionService::Client#predict. -# -def predict - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new - - # Call the predict method. - result = client.predict request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. - p item - end -end -# [END recommendationengine_v1beta1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json deleted file mode 100644 index a7aeab826dc0..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-recommendation_engine-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.recommendationengine.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync", - "title": "Snippet for the create_catalog_item call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item.", - "file": "catalog_service/create_catalog_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_catalog_item", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "CreateCatalogItem", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.CreateCatalogItem", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync", - "title": "Snippet for the get_catalog_item call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item.", - "file": "catalog_service/get_catalog_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_catalog_item", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "GetCatalogItem", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.GetCatalogItem", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync", - "title": "Snippet for the list_catalog_items call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items.", - "file": "catalog_service/list_catalog_items.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_catalog_items", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "ListCatalogItems", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.ListCatalogItems", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync", - "title": "Snippet for the update_catalog_item call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item.", - "file": "catalog_service/update_catalog_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_catalog_item", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "UpdateCatalogItem", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.UpdateCatalogItem", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync", - "title": "Snippet for the delete_catalog_item call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item.", - "file": "catalog_service/delete_catalog_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_catalog_item", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "DeleteCatalogItem", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.DeleteCatalogItem", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync", - "title": "Snippet for the import_catalog_items call in the CatalogService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items.", - "file": "catalog_service/import_catalog_items.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_catalog_items", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CatalogService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client" - }, - "method": { - "short_name": "ImportCatalogItems", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService.ImportCatalogItems", - "service": { - "short_name": "CatalogService", - "full_name": "google.cloud.recommendationengine.v1beta1.CatalogService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync", - "title": "Snippet for the create_prediction_api_key_registration call in the PredictionApiKeyRegistry service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration.", - "file": "prediction_api_key_registry/create_prediction_api_key_registration.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_prediction_api_key_registration", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration", - "client": { - "short_name": "PredictionApiKeyRegistry::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" - }, - "method": { - "short_name": "CreatePredictionApiKeyRegistration", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.CreatePredictionApiKeyRegistration", - "service": { - "short_name": "PredictionApiKeyRegistry", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync", - "title": "Snippet for the list_prediction_api_key_registrations call in the PredictionApiKeyRegistry service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations.", - "file": "prediction_api_key_registry/list_prediction_api_key_registrations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_prediction_api_key_registrations", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse", - "client": { - "short_name": "PredictionApiKeyRegistry::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" - }, - "method": { - "short_name": "ListPredictionApiKeyRegistrations", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.ListPredictionApiKeyRegistrations", - "service": { - "short_name": "PredictionApiKeyRegistry", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync", - "title": "Snippet for the delete_prediction_api_key_registration call in the PredictionApiKeyRegistry service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration.", - "file": "prediction_api_key_registry/delete_prediction_api_key_registration.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_prediction_api_key_registration", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "PredictionApiKeyRegistry::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client" - }, - "method": { - "short_name": "DeletePredictionApiKeyRegistration", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry.DeletePredictionApiKeyRegistration", - "service": { - "short_name": "PredictionApiKeyRegistry", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::PredictionService::Client#predict.", - "file": "prediction_service/predict.rb", - "language": "RUBY", - "client_method": { - "short_name": "predict", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client#predict", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse", - "client": { - "short_name": "PredictionService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client" - }, - "method": { - "short_name": "Predict", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionService.Predict", - "service": { - "short_name": "PredictionService", - "full_name": "google.cloud.recommendationengine.v1beta1.PredictionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#write_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::UserEvent", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" - }, - "method": { - "short_name": "WriteUserEvent", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.WriteUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#collect_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Api::HttpBody", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" - }, - "method": { - "short_name": "CollectUserEvent", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.CollectUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync", - "title": "Snippet for the list_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events.", - "file": "user_event_service/list_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_user_events", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" - }, - "method": { - "short_name": "ListUserEvents", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.ListUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#purge_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" - }, - "method": { - "short_name": "PurgeUserEvents", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.PurgeUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommendationengine_v1beta1_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client#import_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client" - }, - "method": { - "short_name": "ImportUserEvents", - "full_name": "google.cloud.recommendationengine.v1beta1.UserEventService.ImportUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.recommendationengine.v1beta1.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-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb deleted file mode 100644 index 8d96f262e4f7..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# 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::RecommendationEngine::V1beta1::UserEventService::Client#collect_user_event. -# -def collect_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb deleted file mode 100644 index 8a715d8c7c62..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# 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::RecommendationEngine::V1beta1::UserEventService::Client#import_user_events. -# -def import_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb deleted file mode 100644 index 4a9a2321fab9..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.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 recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# Snippet for the list_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::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events. -# -def list_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new - - # Call the list_user_events method. - result = client.list_user_events request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. - p item - end -end -# [END recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb deleted file mode 100644 index e83fe2837090..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# 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::RecommendationEngine::V1beta1::UserEventService::Client#purge_user_events. -# -def purge_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::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 recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb deleted file mode 100644 index 2bb4971f10ec..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/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 recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] -require "google/cloud/recommendation_engine/v1beta1" - -## -# 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::RecommendationEngine::V1beta1::UserEventService::Client#write_user_event. -# -def write_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new - - # Call the write_user_event method. - result = client.write_user_event request - - # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::UserEvent. - p result -end -# [END recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb deleted file mode 100644 index 25c721d36010..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendationengine/v1beta1/catalog_service_pb" -require "google/cloud/recommendationengine/v1beta1/catalog_service_services_pb" -require "google/cloud/recommendation_engine/v1beta1/catalog_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb deleted file mode 100644 index 41e5cdc109a7..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_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/recommendation_engine/v1beta1/catalog_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::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_catalog_item_path_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.catalog_item_path_path project: "value0", location: "value1", catalog: "value2", catalog_item_path: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/catalogItems/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb deleted file mode 100644 index ea8c64d25a13..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb +++ /dev/null @@ -1,432 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/recommendationengine/v1beta1/catalog_service_pb" -require "google/cloud/recommendation_engine/v1beta1/catalog_service/rest" - - -class ::Google::Cloud::RecommendationEngine::V1beta1::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_create_catalog_item - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - catalog_item = {} - - create_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_create_catalog_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_catalog_item({ parent: parent, catalog_item: catalog_item }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_catalog_item parent: parent, catalog_item: catalog_item do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_catalog_item({ parent: parent, catalog_item: catalog_item }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_catalog_item_client_stub.call_count - end - end - end - - def test_get_catalog_item - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_get_catalog_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_catalog_item({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_catalog_item name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_catalog_item({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_catalog_item_client_stub.call_count - end - end - end - - def test_list_catalog_items - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.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_catalog_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_list_catalog_items_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_catalog_items_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_catalog_items({ 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_catalog_items 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items({ 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items_client_stub.call_count - end - end - end - - def test_update_catalog_item - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - catalog_item = {} - update_mask = {} - - update_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_update_catalog_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_catalog_item({ name: name, catalog_item: catalog_item, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_catalog_item name: name, catalog_item: catalog_item, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_catalog_item({ name: name, catalog_item: catalog_item, 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_item(::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item_client_stub.call_count - end - end - end - - def test_delete_catalog_item - # 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_catalog_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_delete_catalog_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_catalog_item({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_catalog_item name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_catalog_item({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_catalog_item_client_stub.call_count - end - end - end - - def test_import_catalog_items - # Create test objects. - 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 = {} - - import_catalog_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::ServiceStub.stub :transcode_import_catalog_items_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_catalog_items_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_catalog_items({ parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_catalog_items parent: parent, request_id: request_id, input_config: input_config, errors_config: errors_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb deleted file mode 100644 index 635d3a216a6f..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb +++ /dev/null @@ -1,494 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommendationengine/v1beta1/catalog_service_pb" -require "google/cloud/recommendation_engine/v1beta1/catalog_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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_create_catalog_item - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - catalog_item = {} - - create_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_catalog_item, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem), request["catalog_item"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_catalog_item({ parent: parent, catalog_item: catalog_item }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_catalog_item parent: parent, catalog_item: catalog_item do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_catalog_item({ parent: parent, catalog_item: catalog_item }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new(parent: parent, catalog_item: catalog_item), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_catalog_item_client_stub.call_rpc_count - end - end - - def test_get_catalog_item - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_catalog_item, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_catalog_item({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_catalog_item name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_catalog_item({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_catalog_item_client_stub.call_rpc_count - end - end - - def test_list_catalog_items - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_catalog_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_catalog_items, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest, 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_catalog_items_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_catalog_items({ 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_catalog_items 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items({ 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.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_catalog_items_client_stub.call_rpc_count - end - end - - def test_update_catalog_item - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - catalog_item = {} - update_mask = {} - - update_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_catalog_item, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem), request["catalog_item"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_catalog_item({ name: name, catalog_item: catalog_item, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_catalog_item name: name, catalog_item: catalog_item, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item({ name: name, catalog_item: catalog_item, 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_item(::Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new(name: name, catalog_item: catalog_item, 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_item_client_stub.call_rpc_count - end - end - - def test_delete_catalog_item - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_catalog_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_catalog_item, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_catalog_item_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_catalog_item({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_catalog_item name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_catalog_item ::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_catalog_item({ 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_catalog_item(::Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new(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_catalog_item_client_stub.call_rpc_count - end - end - - def test_import_catalog_items - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = {} - - import_catalog_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_catalog_items, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::InputConfig), request["input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig), request["errors_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_catalog_items_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items parent: parent, request_id: request_id, 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_catalog_items ::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items({ parent: parent, request_id: request_id, 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_catalog_items(::Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new(parent: parent, request_id: request_id, 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_catalog_items_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::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::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb deleted file mode 100644 index 21186300ee96..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_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/recommendation_engine/v1beta1/prediction_api_key_registry" - -class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_event_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_store_path project: "value0", location: "value1", catalog: "value2", event_store: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3", path - end - end - - def test_prediction_api_key_registration_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.prediction_api_key_registration_path project: "value0", location: "value1", catalog: "value2", event_store: "value3", prediction_api_key_registration: "value4" - assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3/predictionApiKeyRegistrations/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb deleted file mode 100644 index d39ddce351c4..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.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! - -require "helper" -require "gapic/rest" -require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest" - - -class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - prediction_api_key_registration = {} - - create_prediction_api_key_registration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_create_prediction_api_key_registration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_prediction_api_key_registration_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_prediction_api_key_registration parent: parent, prediction_api_key_registration: prediction_api_key_registration do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_prediction_api_key_registration_client_stub.call_count - end - end - end - - def test_list_prediction_api_key_registrations - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.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_prediction_api_key_registrations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_list_prediction_api_key_registrations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_prediction_api_key_registrations_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_prediction_api_key_registrations({ 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_prediction_api_key_registrations 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_prediction_api_key_registrations ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations({ 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_prediction_api_key_registrations(::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations_client_stub.call_count - end - end - end - - def test_delete_prediction_api_key_registration - # 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_prediction_api_key_registration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::ServiceStub.stub :transcode_delete_prediction_api_key_registration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_prediction_api_key_registration_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_prediction_api_key_registration({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_prediction_api_key_registration name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_prediction_api_key_registration({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_prediction_api_key_registration_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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb deleted file mode 100644 index abc7cdd78800..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb +++ /dev/null @@ -1,289 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" - -class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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_prediction_api_key_registration - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - prediction_api_key_registration = {} - - create_prediction_api_key_registration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_prediction_api_key_registration, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration), request["prediction_api_key_registration"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_prediction_api_key_registration_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_prediction_api_key_registration parent: parent, prediction_api_key_registration: prediction_api_key_registration do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_prediction_api_key_registration({ parent: parent, prediction_api_key_registration: prediction_api_key_registration }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new(parent: parent, prediction_api_key_registration: prediction_api_key_registration), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_prediction_api_key_registration_client_stub.call_rpc_count - end - end - - def test_list_prediction_api_key_registrations - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_prediction_api_key_registrations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_prediction_api_key_registrations, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest, 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_prediction_api_key_registrations_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_prediction_api_key_registrations({ parent: parent, page_size: page_size, page_token: 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_prediction_api_key_registrations parent: parent, page_size: page_size, page_token: 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_prediction_api_key_registrations ::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations({ 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_prediction_api_key_registrations(::Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.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_prediction_api_key_registrations_client_stub.call_rpc_count - end - end - - def test_delete_prediction_api_key_registration - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_prediction_api_key_registration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_prediction_api_key_registration, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_prediction_api_key_registration_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_prediction_api_key_registration({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_prediction_api_key_registration name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_prediction_api_key_registration ::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_prediction_api_key_registration({ 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_prediction_api_key_registration(::Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new(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_prediction_api_key_registration_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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::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::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb deleted file mode 100644 index be6c20ea43d8..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendation_engine/v1beta1/prediction_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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_placement_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.placement_path project: "value0", location: "value1", catalog: "value2", event_store: "value3", placement: "value4" - assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3/placements/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb deleted file mode 100644 index 16b9e82a5a80..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/prediction_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_service/rest" - - -class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - user_event = {} - page_size = 42 - page_token = "hello world" - filter = "hello world" - dry_run = 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::RecommendationEngine::V1beta1::PredictionService::Rest::ServiceStub.stub :transcode_predict_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, predict_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.predict name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.predict ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, 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::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb deleted file mode 100644 index 7455360d0c7d..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb +++ /dev/null @@ -1,181 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommendationengine/v1beta1/prediction_service_pb" -require "google/cloud/recommendation_engine/v1beta1/prediction_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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. - name = "hello world" - user_event = {} - page_size = 42 - page_token = "hello world" - filter = "hello world" - dry_run = 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::RecommendationEngine::V1beta1::PredictRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::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["dry_run"] - 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::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.predict name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.predict ::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.predict({ name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.predict(::Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new(name: name, user_event: user_event, page_size: page_size, page_token: page_token, filter: filter, dry_run: dry_run, params: params, labels: labels), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb deleted file mode 100644 index e3226a5ba887..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/user_event_service_pb" -require "google/cloud/recommendationengine/v1beta1/user_event_service_services_pb" -require "google/cloud/recommendation_engine/v1beta1/user_event_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb deleted file mode 100644 index 2bebd9ae77b2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_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/recommendation_engine/v1beta1/user_event_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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_event_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_store_path project: "value0", location: "value1", catalog: "value2", event_store: "value3" - assert_equal "projects/value0/locations/value1/catalogs/value2/eventStores/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb deleted file mode 100644 index 1e04762a5677..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/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/recommendationengine/v1beta1/user_event_service_pb" -require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest" - - -class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.write_user_event parent: parent, user_event: user_event do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event) 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 }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.write_user_event(::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event), 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. - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - - 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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.collect_user_event(::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), 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_list_user_events - # Create test objects. - client_result = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.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_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::RecommendationEngine::V1beta1::UserEventService::Rest::ServiceStub.stub :transcode_list_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_user_events_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_user_events({ 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_user_events 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_user_events ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events({ 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_user_events(::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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" - request_id = "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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_user_events({ parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb deleted file mode 100644 index 3bb097a3c25c..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb +++ /dev/null @@ -1,447 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommendationengine/v1beta1/user_event_service_pb" -require "google/cloud/recommendation_engine/v1beta1/user_event_service" - -class ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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_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::RecommendationEngine::V1beta1::WriteUserEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent), request["user_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, write_user_event_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event }) 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 do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event) 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 }, 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::RecommendationEngine::V1beta1::WriteUserEventRequest.new(parent: parent, user_event: user_event), 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. - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - - 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::RecommendationEngine::V1beta1::CollectUserEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["user_event"] - assert_equal "hello world", request["uri"] - assert_equal 42, request["ets"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, collect_user_event_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, 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::RecommendationEngine::V1beta1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), 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_list_user_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_user_events, name - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest, 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_user_events_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_user_events({ 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_user_events 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_user_events ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events({ 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_user_events(::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.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_user_events_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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" - request_id = "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::RecommendationEngine::V1beta1::ImportUserEventsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::InputConfig), request["input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::RecommendationEngine::V1beta1::ImportErrorsConfig), request["errors_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_user_events_client_stub do - # Create client - client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_user_events({ parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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, request_id: request_id, 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::RecommendationEngine::V1beta1::ImportUserEventsRequest.new(parent: parent, request_id: request_id, 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_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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::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::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-recommendation_engine-v1beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine-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-recommendation_engine/.gitignore b/owl-bot-staging/google-cloud-recommendation_engine/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/.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-recommendation_engine/.repo-metadata.json b/owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json deleted file mode 100644 index b39e1c10e46c..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recommendationengine.googleapis.com", - "api_shortname": "recommendationengine", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine/latest", - "distribution_name": "google-cloud-recommendation_engine", - "is_cloud": true, - "language": "ruby", - "name": "recommendationengine", - "name_pretty": "Recommendations AI API", - "product_documentation": "https://cloud.google.com/recommendations", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Recommendations AI 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": "RECOMMENDATION_ENGINE", - "ruby-cloud-product-url": "https://cloud.google.com/recommendations", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml b/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml deleted file mode 100644 index c4f711187121..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recommendation_engine.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-recommendation_engine.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recommendation_engine/.toys.rb b/owl-bot-staging/google-cloud-recommendation_engine/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/.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-recommendation_engine/.yardopts b/owl-bot-staging/google-cloud-recommendation_engine/.yardopts deleted file mode 100644 index 31cc53ded05b..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Recommendations AI 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-recommendation_engine/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md deleted file mode 100644 index c225dd7f867a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recommendation_engine 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-recommendation_engine 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/recommendation_engine" - -client = Google::Cloud::RecommendationEngine.catalog_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recommendation_engine" - -Google::Cloud::RecommendationEngine.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::RecommendationEngine.catalog_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-recommendation_engine -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/recommendation_engine" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::RecommendationEngine.catalog_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-recommendation_engine/CHANGELOG.md b/owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recommendation_engine/Gemfile b/owl-bot-staging/google-cloud-recommendation_engine/Gemfile deleted file mode 100644 index c5273e254504..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-recommendation_engine-v1beta1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recommendation_engine.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-recommendation_engine/LICENSE.md b/owl-bot-staging/google-cloud-recommendation_engine/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/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-recommendation_engine/README.md b/owl-bot-staging/google-cloud-recommendation_engine/README.md deleted file mode 100644 index e8663089ba0a..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Recommendations AI API - -API Client library for the Recommendations AI API - -Recommendations AI 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-recommendation_engine-v*`. -The gem `google-cloud-recommendation_engine` 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-recommendation_engine/latest) -for this library, google-cloud-recommendation_engine, 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-recommendation_engine-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest). - -See also the [Product Documentation](https://cloud.google.com/recommendations) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-recommendation_engine -``` - -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/recommendationengine.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/recommendation_engine" - -client = Google::Cloud::RecommendationEngine.catalog_service -request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new # (request fields as keyword arguments...) -response = client.create_catalog_item 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-recommendation_engine-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-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-recommendation_engine`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recommendation_engine-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-recommendation_engine`. -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-recommendation_engine-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-recommendation_engine/Rakefile b/owl-bot-staging/google-cloud-recommendation_engine/Rakefile deleted file mode 100644 index 3a827aff4b13..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/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-recommendation_engine acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECOMMENDATION_ENGINE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECOMMENDATION_ENGINE_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 RECOMMENDATION_ENGINE_TEST_PROJECT=test123 RECOMMENDATION_ENGINE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recommendation_engine/v1beta1/catalog_service/credentials" - ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECOMMENDATION_ENGINE_PROJECT"] = project - ENV["RECOMMENDATION_ENGINE_TEST_PROJECT"] = project - ENV["RECOMMENDATION_ENGINE_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-recommendation_engine 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-recommendation_engine 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-recommendation_engine 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-recommendation_engine gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recommendation_engine" - header "google-cloud-recommendation_engine rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recommendation_engine yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recommendation_engine 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-recommendation_engine 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-recommendation_engine 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-recommendation_engine/google-cloud-recommendation_engine.gemspec b/owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec deleted file mode 100644 index dbf29f4e22ff..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/google-cloud-recommendation_engine.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recommendation_engine/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recommendation_engine" - gem.version = Google::Cloud::RecommendationEngine::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Recommendations AI 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 Recommendations AI 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-recommendation_engine-v1beta1", ">= 0.8", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.rb deleted file mode 100644 index afc81d0994a6..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/lib/google-cloud-recommendation_engine.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/recommendation_engine" unless defined? Google::Cloud::RecommendationEngine::VERSION diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb deleted file mode 100644 index 51f6a2acf3ef..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine.rb +++ /dev/null @@ -1,370 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/recommendation_engine/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! :recommendation_engine 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 RecommendationEngine - ## - # Create a new client object for CatalogService. - # - # By default, this returns an instance of - # [Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-CatalogService-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 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::RecommendationEngine.catalog_service_available?}. - # - # ## About CatalogService - # - # Service for ingesting catalog information of the customer's website. - # - # @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.catalog_service version: :v1beta1, transport: :grpc, &block - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.catalog_service_available? version: :v1beta1, transport: :grpc - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RecommendationEngine.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 PredictionApiKeyRegistry. - # - # By default, this returns an instance of - # [Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-PredictionApiKeyRegistry-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 PredictionApiKeyRegistry 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 PredictionApiKeyRegistry service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::RecommendationEngine.prediction_api_key_registry_available?}. - # - # ## About PredictionApiKeyRegistry - # - # Service for registering API keys for use with the `predict` method. If you - # use an API key to request predictions, you must first register the API key. - # Otherwise, your prediction request is rejected. If you use OAuth to - # authenticate your `predict` method call, you do not need to register an API - # key. You can register up to 20 API keys per project. - # - # @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.prediction_api_key_registry version: :v1beta1, transport: :grpc, &block - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RecommendationEngine.const_get(package_name).const_get(:PredictionApiKeyRegistry) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PredictionApiKeyRegistry service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.prediction_api_key_registry}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PredictionApiKeyRegistry service, - # or if the versioned client gem needs an update to support the PredictionApiKeyRegistry 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.prediction_api_key_registry_available? version: :v1beta1, transport: :grpc - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RecommendationEngine.const_get package_name - return false unless service_module.const_defined? :PredictionApiKeyRegistry - service_module = service_module.const_get :PredictionApiKeyRegistry - 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::RecommendationEngine::V1beta1::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-PredictionService-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 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::RecommendationEngine.prediction_service_available?}. - # - # ## About PredictionService - # - # Service for making recommendation prediction. - # - # @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.prediction_service version: :v1beta1, transport: :grpc, &block - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.prediction_service_available? version: :v1beta1, transport: :grpc - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RecommendationEngine.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 UserEventService. - # - # By default, this returns an instance of - # [Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest/Google-Cloud-RecommendationEngine-V1beta1-UserEventService-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 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::RecommendationEngine.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 `:v1beta1`. - # @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: :v1beta1, transport: :grpc, &block - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::RecommendationEngine.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::RecommendationEngine.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 `:v1beta1`. - # @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: :v1beta1, transport: :grpc - require "google/cloud/recommendation_engine/#{version.to_s.downcase}" - package_name = Google::Cloud::RecommendationEngine - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::RecommendationEngine.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-recommendation_engine 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.recommendation_engine if block_given? - - ::Google::Cloud.configure.recommendation_engine - end - end - end -end - -helper_path = ::File.join __dir__, "recommendation_engine", "helpers.rb" -require "google/cloud/recommendation_engine/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb b/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/version.rb deleted file mode 100644 index ab6d2e72fa21..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/lib/google/cloud/recommendation_engine/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 RecommendationEngine - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.rb deleted file mode 100644 index f582f7064a11..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/client_test.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! - -require "helper" -require "google/cloud/recommendation_engine" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::RecommendationEngine::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_catalog_service_grpc - skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.catalog_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client, client - end - end - - def test_catalog_service_rest - skip unless Google::Cloud::RecommendationEngine.catalog_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::RecommendationEngine.catalog_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client, client - end - end - - def test_prediction_api_key_registry_grpc - skip unless Google::Cloud::RecommendationEngine.prediction_api_key_registry_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::RecommendationEngine.prediction_api_key_registry transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client, client - end - end - - def test_prediction_api_key_registry_rest - skip unless Google::Cloud::RecommendationEngine.prediction_api_key_registry_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::RecommendationEngine.prediction_api_key_registry transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client, client - end - end - - def test_prediction_service_grpc - skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.prediction_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client, client - end - end - - def test_prediction_service_rest - skip unless Google::Cloud::RecommendationEngine.prediction_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::RecommendationEngine.prediction_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client, client - end - end - - def test_user_event_service_grpc - skip unless Google::Cloud::RecommendationEngine.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::RecommendationEngine.user_event_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client, client - end - end - - def test_user_event_service_rest - skip unless Google::Cloud::RecommendationEngine.user_event_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::RecommendationEngine.user_event_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/version_test.rb deleted file mode 100644 index fd4e833d1a0e..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/test/google/cloud/recommendation_engine/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/recommendation_engine/version" - -class Google::Cloud::RecommendationEngine::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::RecommendationEngine::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb b/owl-bot-staging/google-cloud-recommendation_engine/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recommendation_engine/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-recommender-v1/.gitignore b/owl-bot-staging/google-cloud-recommender-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json deleted file mode 100644 index b633aec09688..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recommender.googleapis.com", - "api_shortname": "recommender", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest", - "distribution_name": "google-cloud-recommender-v1", - "is_cloud": true, - "language": "ruby", - "name": "recommender", - "name_pretty": "Recommender V1 API", - "product_documentation": "https://cloud.google.com/recommender", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. Note that google-cloud-recommender-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommender instead. See the readme for more details.", - "ruby-cloud-env-prefix": "RECOMMENDER", - "ruby-cloud-product-url": "https://cloud.google.com/recommender", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml b/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml deleted file mode 100644 index 5cc4c15130f9..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recommender-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-recommender-v1.rb" diff --git a/owl-bot-staging/google-cloud-recommender-v1/.toys.rb b/owl-bot-staging/google-cloud-recommender-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/.yardopts b/owl-bot-staging/google-cloud-recommender-v1/.yardopts deleted file mode 100644 index e1a499600bf2..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Recommender 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-recommender-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md deleted file mode 100644 index c576052b3638..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recommender-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-recommender-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/recommender/v1" - -client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recommender/v1" - -::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender-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/recommender/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recommender-v1/Gemfile b/owl-bot-staging/google-cloud-recommender-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/LICENSE.md b/owl-bot-staging/google-cloud-recommender-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/README.md b/owl-bot-staging/google-cloud-recommender-v1/README.md deleted file mode 100644 index 6bce3518215e..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Recommender V1 API - -API Client library for the Recommender V1 API - -Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Recommender V1 API. Most users should consider using -the main client gem, -[google-cloud-recommender](https://rubygems.org/gems/google-cloud-recommender). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-recommender-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/recommender.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/recommender/v1" - -client = ::Google::Cloud::Recommender::V1::Recommender::Client.new -request = ::Google::Cloud::Recommender::V1::ListInsightsRequest.new # (request fields as keyword arguments...) -response = client.list_insights request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/recommender) -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/recommender/v1" -require "logger" - -client = ::Google::Cloud::Recommender::V1::Recommender::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-recommender`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recommender-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-recommender`. -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-recommender-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-recommender-v1/Rakefile b/owl-bot-staging/google-cloud-recommender-v1/Rakefile deleted file mode 100644 index 6f1c5d05dde0..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECOMMENDER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECOMMENDER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECOMMENDER_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 RECOMMENDER_TEST_PROJECT=test123 RECOMMENDER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recommender/v1/recommender/credentials" - ::Google::Cloud::Recommender::V1::Recommender::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECOMMENDER_PROJECT"] = project - ENV["RECOMMENDER_TEST_PROJECT"] = project - ENV["RECOMMENDER_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-recommender-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-recommender-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-recommender-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-recommender-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recommender-v1" - header "google-cloud-recommender-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recommender-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recommender-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-recommender-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-recommender-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-recommender-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json deleted file mode 100644 index a6118686e3b3..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.recommender.v1", - "libraryPackage": "::Google::Cloud::Recommender::V1", - "services": { - "Recommender": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Recommender::V1::Recommender::Client", - "rpcs": { - "ListInsights": { - "methods": [ - "list_insights" - ] - }, - "GetInsight": { - "methods": [ - "get_insight" - ] - }, - "MarkInsightAccepted": { - "methods": [ - "mark_insight_accepted" - ] - }, - "ListRecommendations": { - "methods": [ - "list_recommendations" - ] - }, - "GetRecommendation": { - "methods": [ - "get_recommendation" - ] - }, - "MarkRecommendationDismissed": { - "methods": [ - "mark_recommendation_dismissed" - ] - }, - "MarkRecommendationClaimed": { - "methods": [ - "mark_recommendation_claimed" - ] - }, - "MarkRecommendationSucceeded": { - "methods": [ - "mark_recommendation_succeeded" - ] - }, - "MarkRecommendationFailed": { - "methods": [ - "mark_recommendation_failed" - ] - }, - "GetRecommenderConfig": { - "methods": [ - "get_recommender_config" - ] - }, - "UpdateRecommenderConfig": { - "methods": [ - "update_recommender_config" - ] - }, - "GetInsightTypeConfig": { - "methods": [ - "get_insight_type_config" - ] - }, - "UpdateInsightTypeConfig": { - "methods": [ - "update_insight_type_config" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec b/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec deleted file mode 100644 index f6f8fbe70274..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/google-cloud-recommender-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recommender/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recommender-v1" - gem.version = Google::Cloud::Recommender::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. Note that google-cloud-recommender-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-recommender instead. See the readme for more details." - gem.summary = "API Client library for the Recommender V1 API" - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.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-recommender-v1/lib/google-cloud-recommender-v1.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-v1.rb deleted file mode 100644 index f0d383ec4232..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google-cloud-recommender-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/recommender/v1" diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1.rb deleted file mode 100644 index bb42d7731629..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/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/recommender/v1/recommender" -require "google/cloud/recommender/v1/version" - -module Google - module Cloud - module Recommender - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/recommender/v1" - # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/recommender/v1" - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/recommender/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb deleted file mode 100644 index 81fbb3b3202e..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommender/v1/insight.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/cloud/recommender/v1/insight.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\t\n\x07Insight\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x18\n\x10target_resources\x18\t \x03(\t\x12\x17\n\x0finsight_subtype\x18\n \x01(\t\x12(\n\x07\x63ontent\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x35\n\x11last_refresh_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x12observation_period\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x41\n\nstate_info\x18\x06 \x01(\x0b\x32-.google.cloud.recommender.v1.InsightStateInfo\x12?\n\x08\x63\x61tegory\x18\x07 \x01(\x0e\x32-.google.cloud.recommender.v1.Insight.Category\x12?\n\x08severity\x18\x0f \x01(\x0e\x32-.google.cloud.recommender.v1.Insight.Severity\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12`\n\x1a\x61ssociated_recommendations\x18\x08 \x03(\x0b\x32<.google.cloud.recommender.v1.Insight.RecommendationReference\x1a\x31\n\x17RecommendationReference\x12\x16\n\x0erecommendation\x18\x01 \x01(\t\"\x85\x01\n\x08\x43\x61tegory\x12\x18\n\x14\x43\x41TEGORY_UNSPECIFIED\x10\x00\x12\x08\n\x04\x43OST\x10\x01\x12\x0c\n\x08SECURITY\x10\x02\x12\x0f\n\x0bPERFORMANCE\x10\x03\x12\x11\n\rMANAGEABILITY\x10\x04\x12\x12\n\x0eSUSTAINABILITY\x10\x05\x12\x0f\n\x0bRELIABILITY\x10\x06\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04:\x9f\x03\xea\x41\x9b\x03\n\"recommender.googleapis.com/Insight\x12Vprojects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12\x65\x62illingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12Tfolders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\x12`organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}\"\xaf\x02\n\x10InsightStateInfo\x12\x42\n\x05state\x18\x01 \x01(\x0e\x32\x33.google.cloud.recommender.v1.InsightStateInfo.State\x12X\n\x0estate_metadata\x18\x02 \x03(\x0b\x32@.google.cloud.recommender.v1.InsightStateInfo.StateMetadataEntry\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x02\x12\r\n\tDISMISSED\x10\x03\x42\xf0\x03\n\x1f\x63om.google.cloud.recommender.v1B\x0cInsightProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.V1\xea\x41\xd3\x02\n&recommender.googleapis.com/InsightType\x12\x43projects/{project}/locations/{location}/insightTypes/{insight_type}\x12RbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}\x12\x41\x66olders/{folder}/locations/{location}/insightTypes/{insight_type}\x12Morganizations/{organization}/locations/{location}/insightTypes/{insight_type}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.Struct", "google/protobuf/struct.proto"], - ["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 Recommender - module V1 - Insight = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight").msgclass - Insight::RecommendationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.RecommendationReference").msgclass - Insight::Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.Category").enummodule - Insight::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.Severity").enummodule - InsightStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo").msgclass - InsightStateInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb deleted file mode 100644 index 525fb217f973..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/insight_type_config_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommender/v1/insight_type_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/recommender/v1/insight_type_config.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb1\x05\n\x11InsightTypeConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12`\n\x1einsight_type_generation_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.recommender.v1.InsightTypeGenerationConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0brevision_id\x18\x05 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x06 \x03(\x0b\x32?.google.cloud.recommender.v1.InsightTypeConfig.AnnotationsEntry\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xaf\x02\xea\x41\xab\x02\n,recommender.googleapis.com/InsightTypeConfig\x12Jprojects/{project}/locations/{location}/insightTypes/{insight_type}/config\x12Torganizations/{organization}/locations/{location}/insightTypes/{insight_type}/config\x12YbillingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config\"F\n\x1bInsightTypeGenerationConfig\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\xa3\x01\n\x1f\x63om.google.cloud.recommender.v1B\x16InsightTypeConfigProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.Struct", "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 Recommender - module V1 - InsightTypeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeConfig").msgclass - InsightTypeGenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeGenerationConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb deleted file mode 100644 index 216c86339922..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommendation_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommender/v1/recommendation.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/money_pb' - - -descriptor_data = "\n0google/cloud/recommender/v1/recommendation.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/type/money.proto\"\xa2\t\n\x0eRecommendation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x1b\n\x13recommender_subtype\x18\x0c \x01(\t\x12\x35\n\x11last_refresh_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12;\n\x0eprimary_impact\x18\x05 \x01(\x0b\x32#.google.cloud.recommender.v1.Impact\x12>\n\x11\x61\x64\x64itional_impact\x18\x06 \x03(\x0b\x32#.google.cloud.recommender.v1.Impact\x12\x46\n\x08priority\x18\x11 \x01(\x0e\x32\x34.google.cloud.recommender.v1.Recommendation.Priority\x12\x43\n\x07\x63ontent\x18\x07 \x01(\x0b\x32\x32.google.cloud.recommender.v1.RecommendationContent\x12H\n\nstate_info\x18\n \x01(\x0b\x32\x34.google.cloud.recommender.v1.RecommendationStateInfo\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12Y\n\x13\x61ssociated_insights\x18\x0e \x03(\x0b\x32<.google.cloud.recommender.v1.Recommendation.InsightReference\x12\x14\n\x0cxor_group_id\x18\x12 \x01(\t\x1a#\n\x10InsightReference\x12\x0f\n\x07insight\x18\x01 \x01(\t\"D\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P4\x10\x01\x12\x06\n\x02P3\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P1\x10\x04:\xda\x03\xea\x41\xd6\x03\n)recommender.googleapis.com/Recommendation\x12\x63projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12rbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12\x61\x66olders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\x12morganizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}\"\x89\x01\n\x15RecommendationContent\x12\x45\n\x10operation_groups\x18\x02 \x03(\x0b\x32+.google.cloud.recommender.v1.OperationGroup\x12)\n\x08overview\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"L\n\x0eOperationGroup\x12:\n\noperations\x18\x01 \x03(\x0b\x32&.google.cloud.recommender.v1.Operation\"\xd7\x04\n\tOperation\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\x12\x0c\n\x04path\x18\x04 \x01(\t\x12\x17\n\x0fsource_resource\x18\x05 \x01(\t\x12\x13\n\x0bsource_path\x18\x06 \x01(\t\x12\'\n\x05value\x18\x07 \x01(\x0b\x32\x16.google.protobuf.ValueH\x00\x12\x42\n\rvalue_matcher\x18\n \x01(\x0b\x32).google.cloud.recommender.v1.ValueMatcherH\x00\x12M\n\x0cpath_filters\x18\x08 \x03(\x0b\x32\x37.google.cloud.recommender.v1.Operation.PathFiltersEntry\x12Z\n\x13path_value_matchers\x18\x0b \x03(\x0b\x32=.google.cloud.recommender.v1.Operation.PathValueMatchersEntry\x1aJ\n\x10PathFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x63\n\x16PathValueMatchersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.recommender.v1.ValueMatcher:\x02\x38\x01\x42\x0c\n\npath_value\":\n\x0cValueMatcher\x12\x19\n\x0fmatches_pattern\x18\x01 \x01(\tH\x00\x42\x0f\n\rmatch_variant\"\x93\x01\n\x0e\x43ostProjection\x12 \n\x04\x63ost\x18\x01 \x01(\x0b\x32\x12.google.type.Money\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x16\x63ost_in_local_currency\x18\x03 \x01(\x0b\x32\x12.google.type.Money\">\n\x12SecurityProjection\x12(\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"Y\n\x18SustainabilityProjection\x12\x10\n\x08kg_c_o2e\x18\x01 \x01(\x01\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xec\x01\n\x15ReliabilityProjection\x12J\n\x05risks\x18\x01 \x03(\x0e\x32;.google.cloud.recommender.v1.ReliabilityProjection.RiskType\x12(\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"]\n\x08RiskType\x12\x19\n\x15RISK_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12SERVICE_DISRUPTION\x10\x01\x12\r\n\tDATA_LOSS\x10\x02\x12\x0f\n\x0b\x41\x43\x43\x45SS_DENY\x10\x03\"\xa8\x04\n\x06Impact\x12>\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32,.google.cloud.recommender.v1.Impact.Category\x12\x46\n\x0f\x63ost_projection\x18\x64 \x01(\x0b\x32+.google.cloud.recommender.v1.CostProjectionH\x00\x12N\n\x13security_projection\x18\x65 \x01(\x0b\x32/.google.cloud.recommender.v1.SecurityProjectionH\x00\x12Z\n\x19sustainability_projection\x18\x66 \x01(\x0b\x32\x35.google.cloud.recommender.v1.SustainabilityProjectionH\x00\x12T\n\x16reliability_projection\x18g \x01(\x0b\x32\x32.google.cloud.recommender.v1.ReliabilityProjectionH\x00\"\x85\x01\n\x08\x43\x61tegory\x12\x18\n\x14\x43\x41TEGORY_UNSPECIFIED\x10\x00\x12\x08\n\x04\x43OST\x10\x01\x12\x0c\n\x08SECURITY\x10\x02\x12\x0f\n\x0bPERFORMANCE\x10\x03\x12\x11\n\rMANAGEABILITY\x10\x04\x12\x12\n\x0eSUSTAINABILITY\x10\x05\x12\x0f\n\x0bRELIABILITY\x10\x06\x42\x0c\n\nprojection\"\xde\x02\n\x17RecommendationStateInfo\x12I\n\x05state\x18\x01 \x01(\x0e\x32:.google.cloud.recommender.v1.RecommendationStateInfo.State\x12_\n\x0estate_metadata\x18\x02 \x03(\x0b\x32G.google.cloud.recommender.v1.RecommendationStateInfo.StateMetadataEntry\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"a\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x43LAIMED\x10\x06\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tDISMISSED\x10\x05\x42\xde\x03\n\x1f\x63om.google.cloud.recommender.v1P\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.V1\xea\x41\xcf\x02\n&recommender.googleapis.com/Recommender\x12\x42projects/{project}/locations/{location}/recommenders/{recommender}\x12QbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}\x12@folders/{folder}/locations/{location}/recommenders/{recommender}\x12Lorganizations/{organization}/locations/{location}/recommenders/{recommender}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.Struct", "google/protobuf/struct.proto"], - ["google.type.Money", "google/type/money.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 Recommender - module V1 - Recommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation").msgclass - Recommendation::InsightReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation.InsightReference").msgclass - Recommendation::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation.Priority").enummodule - RecommendationContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationContent").msgclass - OperationGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.OperationGroup").msgclass - Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Operation").msgclass - ValueMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ValueMatcher").msgclass - CostProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.CostProjection").msgclass - SecurityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.SecurityProjection").msgclass - SustainabilityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.SustainabilityProjection").msgclass - ReliabilityProjection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ReliabilityProjection").msgclass - ReliabilityProjection::RiskType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ReliabilityProjection.RiskType").enummodule - Impact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Impact").msgclass - Impact::Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Impact.Category").enummodule - RecommendationStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationStateInfo").msgclass - RecommendationStateInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationStateInfo.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.rb deleted file mode 100644 index 4d8007819497..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender.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/recommender/v1/version" - -require "google/cloud/recommender/v1/recommender/credentials" -require "google/cloud/recommender/v1/recommender/paths" -require "google/cloud/recommender/v1/recommender/client" -require "google/cloud/recommender/v1/recommender/rest" - -module Google - module Cloud - module Recommender - module V1 - ## - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/recommender/v1/recommender" - # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/recommender/v1/recommender/rest" - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - module Recommender - end - end - end - end -end - -helper_path = ::File.join __dir__, "recommender", "helpers.rb" -require "google/cloud/recommender/v1/recommender/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb deleted file mode 100644 index 1e835e67a47e..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/client.rb +++ /dev/null @@ -1,1837 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommender/v1/recommender_service_pb" - -module Google - module Cloud - module Recommender - module V1 - module Recommender - ## - # Client for the Recommender service. - # - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommender.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recommender_stub - - ## - # Configure the Recommender Client class. - # - # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Recommender clients - # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Recommender", "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_insights.timeout = 60.0 - default_config.rpcs.list_insights.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_insight.timeout = 60.0 - default_config.rpcs.get_insight.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.mark_insight_accepted.timeout = 60.0 - - default_config.rpcs.list_recommendations.timeout = 60.0 - default_config.rpcs.list_recommendations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_recommendation.timeout = 60.0 - default_config.rpcs.get_recommendation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.mark_recommendation_claimed.timeout = 60.0 - - default_config.rpcs.mark_recommendation_succeeded.timeout = 60.0 - - default_config.rpcs.mark_recommendation_failed.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Recommender Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @recommender_stub.universe_domain - end - - ## - # Create a new Recommender client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Recommender 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/recommender/v1/recommender_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 - - @recommender_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Recommender::V1::Recommender::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 - ) - - @recommender_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 - @recommender_stub.logger - end - - # Service calls - - ## - # Lists insights for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified insight type. - # - # @overload list_insights(request, options = nil) - # Pass arguments to `list_insights` via a request object, either of type - # {::Google::Cloud::Recommender::V1::ListInsightsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_insights` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # INSIGHT_TYPE_ID refers to supported insight types: - # https://cloud.google.com/recommender/docs/insights/insight-types. - # @param page_size [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @param page_token [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @param filter [::String] - # Optional. Filter expression to restrict the insights returned. Supported - # filter fields: - # - # * `stateInfo.state` - # - # * `insightSubtype` - # - # * `severity` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `insightSubtype = PERMISSIONS_USAGE` - # - # * `severity = CRITICAL OR severity = HIGH` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::ListInsightsRequest.new - # - # # Call the list_insights method. - # result = client.list_insights request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Recommender::V1::Insight. - # p item - # end - # - def list_insights request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_insights.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_insights.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_insights.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :list_insights, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_insights, request, response, 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 requested insight. Requires the recommender.*.get IAM permission - # for the specified insight type. - # - # @overload get_insight(request, options = nil) - # Pass arguments to `get_insight` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetInsightRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetInsightRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_insight(name: nil) - # Pass arguments to `get_insight` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 insight. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetInsightRequest.new - # - # # Call the get_insight method. - # result = client.get_insight request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Insight. - # p result - # - def get_insight request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_insight.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_insight.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_insight.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :get_insight, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Insight State as Accepted. Users can use this method to - # indicate to the Recommender API that they have applied some action based - # on the insight. This stops the insight content from being updated. - # - # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - # the recommender.*.update IAM permission for the specified insight. - # - # @overload mark_insight_accepted(request, options = nil) - # Pass arguments to `mark_insight_accepted` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mark_insight_accepted(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_insight_accepted` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 insight. - # @param state_metadata [::Hash{::String => ::String}] - # Optional. State properties user wish to include with this state. Full - # replace of the current state_metadata. - # @param etag [::String] - # Required. Fingerprint of the Insight. Provides optimistic locking. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new - # - # # Call the mark_insight_accepted method. - # result = client.mark_insight_accepted request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Insight. - # p result - # - def mark_insight_accepted request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mark_insight_accepted.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mark_insight_accepted.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :mark_insight_accepted, request, 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 recommendations for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified recommender. - # - # @overload list_recommendations(request, options = nil) - # Pass arguments to `list_recommendations` via a request object, either of type - # {::Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_recommendations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # RECOMMENDER_ID refers to supported recommenders: - # https://cloud.google.com/recommender/docs/recommenders. - # @param page_size [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @param page_token [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @param filter [::String] - # Filter expression to restrict the recommendations returned. Supported - # filter fields: - # - # * `state_info.state` - # - # * `recommenderSubtype` - # - # * `priority` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - # - # * `priority = P1 OR priority = P2` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new - # - # # Call the list_recommendations method. - # result = client.list_recommendations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. - # p item - # end - # - def list_recommendations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_recommendations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_recommendations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_recommendations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :list_recommendations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_recommendations, request, response, 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 requested recommendation. Requires the recommender.*.get - # IAM permission for the specified recommender. - # - # @overload get_recommendation(request, options = nil) - # Pass arguments to `get_recommendation` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_recommendation(name: nil) - # Pass arguments to `get_recommendation` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new - # - # # Call the get_recommendation method. - # result = client.get_recommendation request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def get_recommendation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_recommendation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_recommendation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_recommendation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :get_recommendation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Mark the Recommendation State as Dismissed. Users can use this method to - # indicate to the Recommender API that an ACTIVE recommendation has to - # be marked back as DISMISSED. - # - # MarkRecommendationDismissed can be applied to recommendations in ACTIVE - # state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_dismissed(request, options = nil) - # Pass arguments to `mark_recommendation_dismissed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mark_recommendation_dismissed(name: nil, etag: nil) - # Pass arguments to `mark_recommendation_dismissed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param etag [::String] - # Fingerprint of the Recommendation. Provides optimistic locking. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new - # - # # Call the mark_recommendation_dismissed method. - # result = client.mark_recommendation_dismissed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_dismissed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mark_recommendation_dismissed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_dismissed.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mark_recommendation_dismissed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :mark_recommendation_dismissed, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Claimed. Users can use this method to - # indicate to the Recommender API that they are starting to apply the - # recommendation themselves. This stops the recommendation content from being - # updated. Associated insights are frozen and placed in the ACCEPTED state. - # - # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - # SUCCEEDED, FAILED, or ACTIVE state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_claimed(request, options = nil) - # Pass arguments to `mark_recommendation_claimed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_claimed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new - # - # # Call the mark_recommendation_claimed method. - # result = client.mark_recommendation_claimed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_claimed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mark_recommendation_claimed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :mark_recommendation_claimed, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Succeeded. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation was successful. This stops the recommendation - # content from being updated. Associated insights are frozen and placed in - # the ACCEPTED state. - # - # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_succeeded(request, options = nil) - # Pass arguments to `mark_recommendation_succeeded` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_succeeded` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new - # - # # Call the mark_recommendation_succeeded method. - # result = client.mark_recommendation_succeeded request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_succeeded request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mark_recommendation_succeeded.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :mark_recommendation_succeeded, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Failed. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation failed. This stops the recommendation content - # from being updated. Associated insights are frozen and placed in the - # ACCEPTED state. - # - # MarkRecommendationFailed can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_failed(request, options = nil) - # Pass arguments to `mark_recommendation_failed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_failed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new - # - # # Call the mark_recommendation_failed method. - # result = client.mark_recommendation_failed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_failed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.mark_recommendation_failed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout, - metadata: metadata, - retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :mark_recommendation_failed, request, 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 requested Recommender Config. There is only one instance of the - # config for each Recommender. - # - # @overload get_recommender_config(request, options = nil) - # Pass arguments to `get_recommender_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_recommender_config(name: nil) - # Pass arguments to `get_recommender_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the Recommendation Config to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new - # - # # Call the get_recommender_config method. - # result = client.get_recommender_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - # p result - # - def get_recommender_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_recommender_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::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_recommender_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_recommender_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :get_recommender_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 Recommender Config. This will create a new revision of the - # config. - # - # @overload update_recommender_config(request, options = nil) - # Pass arguments to `update_recommender_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recommender_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 recommender_config [::Google::Cloud::Recommender::V1::RecommenderConfig, ::Hash] - # Required. The RecommenderConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @param validate_only [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new - # - # # Call the update_recommender_config method. - # result = client.update_recommender_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - # p result - # - def update_recommender_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest - - # Converts hash and nil to 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_recommender_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::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.recommender_config&.name - header_params["recommender_config.name"] = request.recommender_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_recommender_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_recommender_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :update_recommender_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the requested InsightTypeConfig. There is only one instance of the - # config for each InsightType. - # - # @overload get_insight_type_config(request, options = nil) - # Pass arguments to `get_insight_type_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_insight_type_config(name: nil) - # Pass arguments to `get_insight_type_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the InsightTypeConfig to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new - # - # # Call the get_insight_type_config method. - # result = client.get_insight_type_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - # p result - # - def get_insight_type_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_insight_type_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::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_insight_type_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :get_insight_type_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an InsightTypeConfig change. This will create a new revision of the - # config. - # - # @overload update_insight_type_config(request, options = nil) - # Pass arguments to `update_insight_type_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_insight_type_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 insight_type_config [::Google::Cloud::Recommender::V1::InsightTypeConfig, ::Hash] - # Required. The InsightTypeConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @param validate_only [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new - # - # # Call the update_insight_type_config method. - # result = client.update_insight_type_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - # p result - # - def update_insight_type_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest - - # Converts hash and nil to 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_insight_type_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::Recommender::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.insight_type_config&.name - header_params["insight_type_config.name"] = request.insight_type_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_insight_type_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_insight_type_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.call_rpc :update_insight_type_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 - - ## - # Configuration class for the Recommender API. - # - # This class represents the configuration for Recommender, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_insights to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_insights.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_insights.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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::Recommender::V1::Recommender::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 = "recommender.googleapis.com" - - config_attr :endpoint, nil, ::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 Recommender API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_insights` - # @return [::Gapic::Config::Method] - # - attr_reader :list_insights - ## - # RPC-specific configuration for `get_insight` - # @return [::Gapic::Config::Method] - # - attr_reader :get_insight - ## - # RPC-specific configuration for `mark_insight_accepted` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_insight_accepted - ## - # RPC-specific configuration for `list_recommendations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recommendations - ## - # RPC-specific configuration for `get_recommendation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recommendation - ## - # RPC-specific configuration for `mark_recommendation_dismissed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_dismissed - ## - # RPC-specific configuration for `mark_recommendation_claimed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_claimed - ## - # RPC-specific configuration for `mark_recommendation_succeeded` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_succeeded - ## - # RPC-specific configuration for `mark_recommendation_failed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_failed - ## - # RPC-specific configuration for `get_recommender_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recommender_config - ## - # RPC-specific configuration for `update_recommender_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recommender_config - ## - # RPC-specific configuration for `get_insight_type_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_insight_type_config - ## - # RPC-specific configuration for `update_insight_type_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_insight_type_config - - # @private - def initialize parent_rpcs = nil - list_insights_config = parent_rpcs.list_insights if parent_rpcs.respond_to? :list_insights - @list_insights = ::Gapic::Config::Method.new list_insights_config - get_insight_config = parent_rpcs.get_insight if parent_rpcs.respond_to? :get_insight - @get_insight = ::Gapic::Config::Method.new get_insight_config - mark_insight_accepted_config = parent_rpcs.mark_insight_accepted if parent_rpcs.respond_to? :mark_insight_accepted - @mark_insight_accepted = ::Gapic::Config::Method.new mark_insight_accepted_config - list_recommendations_config = parent_rpcs.list_recommendations if parent_rpcs.respond_to? :list_recommendations - @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config - get_recommendation_config = parent_rpcs.get_recommendation if parent_rpcs.respond_to? :get_recommendation - @get_recommendation = ::Gapic::Config::Method.new get_recommendation_config - mark_recommendation_dismissed_config = parent_rpcs.mark_recommendation_dismissed if parent_rpcs.respond_to? :mark_recommendation_dismissed - @mark_recommendation_dismissed = ::Gapic::Config::Method.new mark_recommendation_dismissed_config - mark_recommendation_claimed_config = parent_rpcs.mark_recommendation_claimed if parent_rpcs.respond_to? :mark_recommendation_claimed - @mark_recommendation_claimed = ::Gapic::Config::Method.new mark_recommendation_claimed_config - mark_recommendation_succeeded_config = parent_rpcs.mark_recommendation_succeeded if parent_rpcs.respond_to? :mark_recommendation_succeeded - @mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config - mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed - @mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config - get_recommender_config_config = parent_rpcs.get_recommender_config if parent_rpcs.respond_to? :get_recommender_config - @get_recommender_config = ::Gapic::Config::Method.new get_recommender_config_config - update_recommender_config_config = parent_rpcs.update_recommender_config if parent_rpcs.respond_to? :update_recommender_config - @update_recommender_config = ::Gapic::Config::Method.new update_recommender_config_config - get_insight_type_config_config = parent_rpcs.get_insight_type_config if parent_rpcs.respond_to? :get_insight_type_config - @get_insight_type_config = ::Gapic::Config::Method.new get_insight_type_config_config - update_insight_type_config_config = parent_rpcs.update_insight_type_config if parent_rpcs.respond_to? :update_insight_type_config - @update_insight_type_config = ::Gapic::Config::Method.new update_insight_type_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/credentials.rb deleted file mode 100644 index acb6161ca759..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/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 Recommender - module V1 - module Recommender - # Credentials for the Recommender API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "RECOMMENDER_CREDENTIALS", - "RECOMMENDER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "RECOMMENDER_CREDENTIALS_JSON", - "RECOMMENDER_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-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb deleted file mode 100644 index 89366822975a..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/paths.rb +++ /dev/null @@ -1,457 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - module Recommender - # Path helper methods for the Recommender API. - module Paths - ## - # Create a fully-qualified Insight resource string. - # - # @overload insight_path(project:, location:, insight_type:, insight:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` - # - # @param project [String] - # @param location [String] - # @param insight_type [String] - # @param insight [String] - # - # @overload insight_path(billing_account:, location:, insight_type:, insight:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` - # - # @param billing_account [String] - # @param location [String] - # @param insight_type [String] - # @param insight [String] - # - # @overload insight_path(folder:, location:, insight_type:, insight:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` - # - # @param folder [String] - # @param location [String] - # @param insight_type [String] - # @param insight [String] - # - # @overload insight_path(organization:, location:, insight_type:, insight:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}` - # - # @param organization [String] - # @param location [String] - # @param insight_type [String] - # @param insight [String] - # - # @return [::String] - def insight_path **args - resources = { - "insight:insight_type:location:project" => (proc do |project:, location:, insight_type:, insight:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" - - "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" - end), - "billing_account:insight:insight_type:location" => (proc do |billing_account:, location:, insight_type:, insight:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" - end), - "folder:insight:insight_type:location" => (proc do |folder:, location:, insight_type:, insight:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" - end), - "insight:insight_type:location:organization" => (proc do |organization:, location:, insight_type:, insight:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}" - 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 InsightType resource string. - # - # @overload insight_type_path(project:, location:, insight_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/insightTypes/{insight_type}` - # - # @param project [String] - # @param location [String] - # @param insight_type [String] - # - # @overload insight_type_path(billing_account:, location:, insight_type:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}` - # - # @param billing_account [String] - # @param location [String] - # @param insight_type [String] - # - # @overload insight_type_path(folder:, location:, insight_type:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/insightTypes/{insight_type}` - # - # @param folder [String] - # @param location [String] - # @param insight_type [String] - # - # @overload insight_type_path(organization:, location:, insight_type:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}` - # - # @param organization [String] - # @param location [String] - # @param insight_type [String] - # - # @return [::String] - def insight_type_path **args - resources = { - "insight_type:location:project" => (proc do |project:, location:, insight_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}" - end), - "billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}" - end), - "folder:insight_type:location" => (proc do |folder:, location:, insight_type:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}" - end), - "insight_type:location:organization" => (proc do |organization:, location:, insight_type:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}" - 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 InsightTypeConfig resource string. - # - # @overload insight_type_config_path(project:, location:, insight_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/insightTypes/{insight_type}/config` - # - # @param project [String] - # @param location [String] - # @param insight_type [String] - # - # @overload insight_type_config_path(organization:, location:, insight_type:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config` - # - # @param organization [String] - # @param location [String] - # @param insight_type [String] - # - # @overload insight_type_config_path(billing_account:, location:, insight_type:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config` - # - # @param billing_account [String] - # @param location [String] - # @param insight_type [String] - # - # @return [::String] - def insight_type_config_path **args - resources = { - "insight_type:location:project" => (proc do |project:, location:, insight_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/config" - end), - "insight_type:location:organization" => (proc do |organization:, location:, insight_type:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/config" - end), - "billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/config" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Recommendation resource string. - # - # @overload recommendation_path(project:, location:, recommender:, recommendation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` - # - # @param project [String] - # @param location [String] - # @param recommender [String] - # @param recommendation [String] - # - # @overload recommendation_path(billing_account:, location:, recommender:, recommendation:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` - # - # @param billing_account [String] - # @param location [String] - # @param recommender [String] - # @param recommendation [String] - # - # @overload recommendation_path(folder:, location:, recommender:, recommendation:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` - # - # @param folder [String] - # @param location [String] - # @param recommender [String] - # @param recommendation [String] - # - # @overload recommendation_path(organization:, location:, recommender:, recommendation:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}` - # - # @param organization [String] - # @param location [String] - # @param recommender [String] - # @param recommendation [String] - # - # @return [::String] - def recommendation_path **args - resources = { - "location:project:recommendation:recommender" => (proc do |project:, location:, recommender:, recommendation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" - - "projects/#{project}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" - end), - "billing_account:location:recommendation:recommender" => (proc do |billing_account:, location:, recommender:, recommendation:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" - end), - "folder:location:recommendation:recommender" => (proc do |folder:, location:, recommender:, recommendation:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" - end), - "location:organization:recommendation:recommender" => (proc do |organization:, location:, recommender:, recommendation:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}" - 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 Recommender resource string. - # - # @overload recommender_path(project:, location:, recommender:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/recommenders/{recommender}` - # - # @param project [String] - # @param location [String] - # @param recommender [String] - # - # @overload recommender_path(billing_account:, location:, recommender:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}` - # - # @param billing_account [String] - # @param location [String] - # @param recommender [String] - # - # @overload recommender_path(folder:, location:, recommender:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/recommenders/{recommender}` - # - # @param folder [String] - # @param location [String] - # @param recommender [String] - # - # @overload recommender_path(organization:, location:, recommender:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/recommenders/{recommender}` - # - # @param organization [String] - # @param location [String] - # @param recommender [String] - # - # @return [::String] - def recommender_path **args - resources = { - "location:project:recommender" => (proc do |project:, location:, recommender:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/recommenders/#{recommender}" - end), - "billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}" - end), - "folder:location:recommender" => (proc do |folder:, location:, recommender:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/recommenders/#{recommender}" - end), - "location:organization:recommender" => (proc do |organization:, location:, recommender:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}" - 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 RecommenderConfig resource string. - # - # @overload recommender_config_path(project:, location:, recommender:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/recommenders/{recommender}/config` - # - # @param project [String] - # @param location [String] - # @param recommender [String] - # - # @overload recommender_config_path(organization:, location:, recommender:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/recommenders/{recommender}/config` - # - # @param organization [String] - # @param location [String] - # @param recommender [String] - # - # @overload recommender_config_path(billing_account:, location:, recommender:) - # The resource will be in the following format: - # - # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config` - # - # @param billing_account [String] - # @param location [String] - # @param recommender [String] - # - # @return [::String] - def recommender_config_path **args - resources = { - "location:project:recommender" => (proc do |project:, location:, recommender:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/recommenders/#{recommender}/config" - end), - "location:organization:recommender" => (proc do |organization:, location:, recommender:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/config" - end), - "billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:| - raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/config" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest.rb deleted file mode 100644 index 60528db6ec70..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/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/recommender/v1/version" - -require "google/cloud/recommender/v1/recommender/credentials" -require "google/cloud/recommender/v1/recommender/paths" -require "google/cloud/recommender/v1/recommender/rest/client" - -module Google - module Cloud - module Recommender - module V1 - ## - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/recommender/v1/recommender/rest" - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - module Recommender - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/recommender/v1/recommender/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb deleted file mode 100644 index cec4771e7261..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/client.rb +++ /dev/null @@ -1,1703 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/recommender/v1/recommender_service_pb" -require "google/cloud/recommender/v1/recommender/rest/service_stub" - -module Google - module Cloud - module Recommender - module V1 - module Recommender - module Rest - ## - # REST client for the Recommender service. - # - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "recommender.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recommender_stub - - ## - # Configure the Recommender Client class. - # - # See {::Google::Cloud::Recommender::V1::Recommender::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Recommender clients - # ::Google::Cloud::Recommender::V1::Recommender::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", "Recommender", "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_insights.timeout = 60.0 - default_config.rpcs.list_insights.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_insight.timeout = 60.0 - default_config.rpcs.get_insight.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.mark_insight_accepted.timeout = 60.0 - - default_config.rpcs.list_recommendations.timeout = 60.0 - default_config.rpcs.list_recommendations.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_recommendation.timeout = 60.0 - default_config.rpcs.get_recommendation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.mark_recommendation_claimed.timeout = 60.0 - - default_config.rpcs.mark_recommendation_succeeded.timeout = 60.0 - - default_config.rpcs.mark_recommendation_failed.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Recommender Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Recommender::V1::Recommender::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 - @recommender_stub.universe_domain - end - - ## - # Create a new Recommender REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Recommender 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 - - @recommender_stub = ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @recommender_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 - @recommender_stub.logger - end - - # Service calls - - ## - # Lists insights for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified insight type. - # - # @overload list_insights(request, options = nil) - # Pass arguments to `list_insights` via a request object, either of type - # {::Google::Cloud::Recommender::V1::ListInsightsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_insights` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # INSIGHT_TYPE_ID refers to supported insight types: - # https://cloud.google.com/recommender/docs/insights/insight-types. - # @param page_size [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @param page_token [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @param filter [::String] - # Optional. Filter expression to restrict the insights returned. Supported - # filter fields: - # - # * `stateInfo.state` - # - # * `insightSubtype` - # - # * `severity` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `insightSubtype = PERMISSIONS_USAGE` - # - # * `severity = CRITICAL OR severity = HIGH` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::ListInsightsRequest.new - # - # # Call the list_insights method. - # result = client.list_insights request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Recommender::V1::Insight. - # p item - # end - # - def list_insights request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_insights.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_insights.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_insights.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.list_insights request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_insights, "insights", request, result, 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 requested insight. Requires the recommender.*.get IAM permission - # for the specified insight type. - # - # @overload get_insight(request, options = nil) - # Pass arguments to `get_insight` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetInsightRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetInsightRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_insight(name: nil) - # Pass arguments to `get_insight` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 insight. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetInsightRequest.new - # - # # Call the get_insight method. - # result = client.get_insight request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Insight. - # p result - # - def get_insight request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_insight.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_insight.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_insight.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.get_insight request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Insight State as Accepted. Users can use this method to - # indicate to the Recommender API that they have applied some action based - # on the insight. This stops the insight content from being updated. - # - # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - # the recommender.*.update IAM permission for the specified insight. - # - # @overload mark_insight_accepted(request, options = nil) - # Pass arguments to `mark_insight_accepted` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mark_insight_accepted(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_insight_accepted` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 insight. - # @param state_metadata [::Hash{::String => ::String}] - # Optional. State properties user wish to include with this state. Full - # replace of the current state_metadata. - # @param etag [::String] - # Required. Fingerprint of the Insight. Provides optimistic locking. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new - # - # # Call the mark_insight_accepted method. - # result = client.mark_insight_accepted request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Insight. - # p result - # - def mark_insight_accepted request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mark_insight_accepted.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mark_insight_accepted.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.mark_insight_accepted request, 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 recommendations for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified recommender. - # - # @overload list_recommendations(request, options = nil) - # Pass arguments to `list_recommendations` via a request object, either of type - # {::Google::Cloud::Recommender::V1::ListRecommendationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_recommendations(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_recommendations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # RECOMMENDER_ID refers to supported recommenders: - # https://cloud.google.com/recommender/docs/recommenders. - # @param page_size [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @param page_token [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @param filter [::String] - # Filter expression to restrict the recommendations returned. Supported - # filter fields: - # - # * `state_info.state` - # - # * `recommenderSubtype` - # - # * `priority` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - # - # * `priority = P1 OR priority = P2` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new - # - # # Call the list_recommendations method. - # result = client.list_recommendations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. - # p item - # end - # - def list_recommendations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListRecommendationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_recommendations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_recommendations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_recommendations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.list_recommendations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @recommender_stub, :list_recommendations, "recommendations", request, result, 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 requested recommendation. Requires the recommender.*.get - # IAM permission for the specified recommender. - # - # @overload get_recommendation(request, options = nil) - # Pass arguments to `get_recommendation` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetRecommendationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_recommendation(name: nil) - # Pass arguments to `get_recommendation` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new - # - # # Call the get_recommendation method. - # result = client.get_recommendation request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def get_recommendation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommendationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_recommendation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_recommendation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_recommendation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.get_recommendation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Mark the Recommendation State as Dismissed. Users can use this method to - # indicate to the Recommender API that an ACTIVE recommendation has to - # be marked back as DISMISSED. - # - # MarkRecommendationDismissed can be applied to recommendations in ACTIVE - # state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_dismissed(request, options = nil) - # Pass arguments to `mark_recommendation_dismissed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mark_recommendation_dismissed(name: nil, etag: nil) - # Pass arguments to `mark_recommendation_dismissed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param etag [::String] - # Fingerprint of the Recommendation. Provides optimistic locking. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new - # - # # Call the mark_recommendation_dismissed method. - # result = client.mark_recommendation_dismissed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_dismissed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mark_recommendation_dismissed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_dismissed.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mark_recommendation_dismissed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.mark_recommendation_dismissed request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Claimed. Users can use this method to - # indicate to the Recommender API that they are starting to apply the - # recommendation themselves. This stops the recommendation content from being - # updated. Associated insights are frozen and placed in the ACCEPTED state. - # - # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - # SUCCEEDED, FAILED, or ACTIVE state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_claimed(request, options = nil) - # Pass arguments to `mark_recommendation_claimed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mark_recommendation_claimed(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_claimed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new - # - # # Call the mark_recommendation_claimed method. - # result = client.mark_recommendation_claimed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_claimed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mark_recommendation_claimed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.mark_recommendation_claimed request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Succeeded. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation was successful. This stops the recommendation - # content from being updated. Associated insights are frozen and placed in - # the ACCEPTED state. - # - # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_succeeded(request, options = nil) - # Pass arguments to `mark_recommendation_succeeded` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mark_recommendation_succeeded(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_succeeded` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new - # - # # Call the mark_recommendation_succeeded method. - # result = client.mark_recommendation_succeeded request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_succeeded request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mark_recommendation_succeeded.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.mark_recommendation_succeeded request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Marks the Recommendation State as Failed. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation failed. This stops the recommendation content - # from being updated. Associated insights are frozen and placed in the - # ACCEPTED state. - # - # MarkRecommendationFailed can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - # - # @overload mark_recommendation_failed(request, options = nil) - # Pass arguments to `mark_recommendation_failed` via a request object, either of type - # {::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload mark_recommendation_failed(name: nil, state_metadata: nil, etag: nil) - # Pass arguments to `mark_recommendation_failed` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 recommendation. - # @param state_metadata [::Hash{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @param etag [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new - # - # # Call the mark_recommendation_failed method. - # result = client.mark_recommendation_failed request - # - # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - # p result - # - def mark_recommendation_failed request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.mark_recommendation_failed.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.mark_recommendation_failed request, 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 requested Recommender Config. There is only one instance of the - # config for each Recommender. - # - # @overload get_recommender_config(request, options = nil) - # Pass arguments to `get_recommender_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_recommender_config(name: nil) - # Pass arguments to `get_recommender_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the Recommendation Config to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new - # - # # Call the get_recommender_config method. - # result = client.get_recommender_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - # p result - # - def get_recommender_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_recommender_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::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_recommender_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_recommender_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.get_recommender_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 Recommender Config. This will create a new revision of the - # config. - # - # @overload update_recommender_config(request, options = nil) - # Pass arguments to `update_recommender_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_recommender_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 recommender_config [::Google::Cloud::Recommender::V1::RecommenderConfig, ::Hash] - # Required. The RecommenderConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @param validate_only [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new - # - # # Call the update_recommender_config method. - # result = client.update_recommender_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - # p result - # - def update_recommender_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest - - # Converts hash and nil to an 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_recommender_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::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_recommender_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_recommender_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.update_recommender_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the requested InsightTypeConfig. There is only one instance of the - # config for each InsightType. - # - # @overload get_insight_type_config(request, options = nil) - # Pass arguments to `get_insight_type_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_insight_type_config(name: nil) - # Pass arguments to `get_insight_type_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the InsightTypeConfig to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new - # - # # Call the get_insight_type_config method. - # result = client.get_insight_type_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - # p result - # - def get_insight_type_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_insight_type_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::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_insight_type_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.get_insight_type_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an InsightTypeConfig change. This will create a new revision of the - # config. - # - # @overload update_insight_type_config(request, options = nil) - # Pass arguments to `update_insight_type_config` via a request object, either of type - # {::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil) - # Pass arguments to `update_insight_type_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 insight_type_config [::Google::Cloud::Recommender::V1::InsightTypeConfig, ::Hash] - # Required. The InsightTypeConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @param validate_only [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/recommender/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new - # - # # Call the update_insight_type_config method. - # result = client.update_insight_type_config request - # - # # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - # p result - # - def update_insight_type_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest - - # Converts hash and nil to an 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_insight_type_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::Recommender::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_insight_type_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_insight_type_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommender_stub.update_insight_type_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Recommender REST API. - # - # This class represents the configuration for Recommender 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::Recommender::V1::Recommender::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_insights to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_insights.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_insights.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint 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 = "recommender.googleapis.com" - - config_attr :endpoint, nil, ::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 Recommender API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_insights` - # @return [::Gapic::Config::Method] - # - attr_reader :list_insights - ## - # RPC-specific configuration for `get_insight` - # @return [::Gapic::Config::Method] - # - attr_reader :get_insight - ## - # RPC-specific configuration for `mark_insight_accepted` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_insight_accepted - ## - # RPC-specific configuration for `list_recommendations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_recommendations - ## - # RPC-specific configuration for `get_recommendation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recommendation - ## - # RPC-specific configuration for `mark_recommendation_dismissed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_dismissed - ## - # RPC-specific configuration for `mark_recommendation_claimed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_claimed - ## - # RPC-specific configuration for `mark_recommendation_succeeded` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_succeeded - ## - # RPC-specific configuration for `mark_recommendation_failed` - # @return [::Gapic::Config::Method] - # - attr_reader :mark_recommendation_failed - ## - # RPC-specific configuration for `get_recommender_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_recommender_config - ## - # RPC-specific configuration for `update_recommender_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_recommender_config - ## - # RPC-specific configuration for `get_insight_type_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_insight_type_config - ## - # RPC-specific configuration for `update_insight_type_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_insight_type_config - - # @private - def initialize parent_rpcs = nil - list_insights_config = parent_rpcs.list_insights if parent_rpcs.respond_to? :list_insights - @list_insights = ::Gapic::Config::Method.new list_insights_config - get_insight_config = parent_rpcs.get_insight if parent_rpcs.respond_to? :get_insight - @get_insight = ::Gapic::Config::Method.new get_insight_config - mark_insight_accepted_config = parent_rpcs.mark_insight_accepted if parent_rpcs.respond_to? :mark_insight_accepted - @mark_insight_accepted = ::Gapic::Config::Method.new mark_insight_accepted_config - list_recommendations_config = parent_rpcs.list_recommendations if parent_rpcs.respond_to? :list_recommendations - @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config - get_recommendation_config = parent_rpcs.get_recommendation if parent_rpcs.respond_to? :get_recommendation - @get_recommendation = ::Gapic::Config::Method.new get_recommendation_config - mark_recommendation_dismissed_config = parent_rpcs.mark_recommendation_dismissed if parent_rpcs.respond_to? :mark_recommendation_dismissed - @mark_recommendation_dismissed = ::Gapic::Config::Method.new mark_recommendation_dismissed_config - mark_recommendation_claimed_config = parent_rpcs.mark_recommendation_claimed if parent_rpcs.respond_to? :mark_recommendation_claimed - @mark_recommendation_claimed = ::Gapic::Config::Method.new mark_recommendation_claimed_config - mark_recommendation_succeeded_config = parent_rpcs.mark_recommendation_succeeded if parent_rpcs.respond_to? :mark_recommendation_succeeded - @mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config - mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed - @mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config - get_recommender_config_config = parent_rpcs.get_recommender_config if parent_rpcs.respond_to? :get_recommender_config - @get_recommender_config = ::Gapic::Config::Method.new get_recommender_config_config - update_recommender_config_config = parent_rpcs.update_recommender_config if parent_rpcs.respond_to? :update_recommender_config - @update_recommender_config = ::Gapic::Config::Method.new update_recommender_config_config - get_insight_type_config_config = parent_rpcs.get_insight_type_config if parent_rpcs.respond_to? :get_insight_type_config - @get_insight_type_config = ::Gapic::Config::Method.new get_insight_type_config_config - update_insight_type_config_config = parent_rpcs.update_insight_type_config if parent_rpcs.respond_to? :update_insight_type_config - @update_insight_type_config = ::Gapic::Config::Method.new update_insight_type_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb deleted file mode 100644 index a82f3ae1664b..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb +++ /dev/null @@ -1,1145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/recommender/v1/recommender_service_pb" - -module Google - module Cloud - module Recommender - module V1 - module Recommender - module Rest - ## - # REST service stub for the Recommender 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_insights REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::ListInsightsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::ListInsightsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::ListInsightsResponse] - # A result object deserialized from the server's reply - def list_insights request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_insights_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_insights", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::ListInsightsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_insight REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # A result object deserialized from the server's reply - def get_insight request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_insight_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_insight", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Insight.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mark_insight_accepted REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Insight] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Insight] - # A result object deserialized from the server's reply - def mark_insight_accepted request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mark_insight_accepted_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mark_insight_accepted", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Insight.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_recommendations REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::ListRecommendationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::ListRecommendationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::ListRecommendationsResponse] - # A result object deserialized from the server's reply - def list_recommendations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_recommendations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_recommendations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_recommendation REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommendationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # A result object deserialized from the server's reply - def get_recommendation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_recommendation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_recommendation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mark_recommendation_dismissed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # A result object deserialized from the server's reply - def mark_recommendation_dismissed request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_dismissed_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mark_recommendation_dismissed", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mark_recommendation_claimed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # A result object deserialized from the server's reply - def mark_recommendation_claimed request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_claimed_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mark_recommendation_claimed", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mark_recommendation_succeeded REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # A result object deserialized from the server's reply - def mark_recommendation_succeeded request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_succeeded_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mark_recommendation_succeeded", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the mark_recommendation_failed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::Recommendation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::Recommendation] - # A result object deserialized from the server's reply - def mark_recommendation_failed request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_mark_recommendation_failed_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "mark_recommendation_failed", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::Recommendation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_recommender_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # A result object deserialized from the server's reply - def get_recommender_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_recommender_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_recommender_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::RecommenderConfig.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_recommender_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::RecommenderConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # A result object deserialized from the server's reply - def update_recommender_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_recommender_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_recommender_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::RecommenderConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_insight_type_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # A result object deserialized from the server's reply - def get_insight_type_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_insight_type_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_insight_type_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.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_insight_type_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # A result object deserialized from the server's reply - def update_insight_type_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_insight_type_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_insight_type_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.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_insights REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::ListInsightsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_insights_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/insights", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/insights", - matches: [ - ["parent", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/insights", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/insights", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_insight REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_insight_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mark_insight_accepted REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mark_insight_accepted_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markAccepted", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markAccepted", - body: "*", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markAccepted", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markAccepted", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/insights/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_recommendations REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::ListRecommendationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_recommendations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/recommendations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/recommendations", - matches: [ - ["parent", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/recommendations", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/recommendations", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_recommendation REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommendationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_recommendation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mark_recommendation_dismissed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mark_recommendation_dismissed_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markDismissed", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markDismissed", - body: "*", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markDismissed", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markDismissed", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mark_recommendation_claimed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mark_recommendation_claimed_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markClaimed", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markClaimed", - body: "*", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markClaimed", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markClaimed", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mark_recommendation_succeeded REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mark_recommendation_succeeded_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markSucceeded", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markSucceeded", - body: "*", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markSucceeded", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markSucceeded", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the mark_recommendation_failed REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_mark_recommendation_failed_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markFailed", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markFailed", - body: "*", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markFailed", - body: "*", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:markFailed", - body: "*", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/recommendations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_recommender_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_recommender_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_recommender_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest] - # 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_recommender_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{recommender_config.name}", - body: "recommender_config", - matches: [ - ["recommender_config.name", %r{^projects/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{recommender_config.name}", - body: "recommender_config", - matches: [ - ["recommender_config.name", %r{^organizations/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{recommender_config.name}", - body: "recommender_config", - matches: [ - ["recommender_config.name", %r{^billingAccounts/[^/]+/locations/[^/]+/recommenders/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_insight_type_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_insight_type_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_insight_type_config REST call - # - # @param request_pb [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest] - # 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_insight_type_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{insight_type_config.name}", - body: "insight_type_config", - matches: [ - ["insight_type_config.name", %r{^projects/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{insight_type_config.name}", - body: "insight_type_config", - matches: [ - ["insight_type_config.name", %r{^organizations/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{insight_type_config.name}", - body: "insight_type_config", - matches: [ - ["insight_type_config.name", %r{^billingAccounts/[^/]+/locations/[^/]+/insightTypes/[^/]+/config/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb deleted file mode 100644 index a718b4c37839..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_config_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommender/v1/recommender_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/recommender/v1/recommender_config.proto\x12\x1bgoogle.cloud.recommender.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xad\x05\n\x11RecommenderConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12_\n\x1drecommender_generation_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.recommender.v1.RecommenderGenerationConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0brevision_id\x18\x05 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x06 \x03(\x0b\x32?.google.cloud.recommender.v1.RecommenderConfig.AnnotationsEntry\x12\x14\n\x0c\x64isplay_name\x18\x07 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xac\x02\xea\x41\xa8\x02\n,recommender.googleapis.com/RecommenderConfig\x12Iprojects/{project}/locations/{location}/recommenders/{recommender}/config\x12Sorganizations/{organization}/locations/{location}/recommenders/{recommender}/config\x12XbillingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config\"F\n\x1bRecommenderGenerationConfig\x12\'\n\x06params\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\xa3\x01\n\x1f\x63om.google.cloud.recommender.v1B\x16RecommenderConfigProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.Struct", "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 Recommender - module V1 - RecommenderConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommenderConfig").msgclass - RecommenderGenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommenderGenerationConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb deleted file mode 100644 index 77791d6394ea..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/recommender/v1/recommender_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/recommender/v1/insight_pb' -require 'google/cloud/recommender/v1/insight_type_config_pb' -require 'google/cloud/recommender/v1/recommendation_pb' -require 'google/cloud/recommender/v1/recommender_config_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n5google/cloud/recommender/v1/recommender_service.proto\x12\x1bgoogle.cloud.recommender.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/recommender/v1/insight.proto\x1a\x35google/cloud/recommender/v1/insight_type_config.proto\x1a\x30google/cloud/recommender/v1/recommendation.proto\x1a\x34google/cloud/recommender/v1/recommender_config.proto\x1a google/protobuf/field_mask.proto\"\x9b\x01\n\x13ListInsightsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recommender.googleapis.com/InsightType\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\"g\n\x14ListInsightsResponse\x12\x36\n\x08insights\x18\x01 \x03(\x0b\x32$.google.cloud.recommender.v1.Insight\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"M\n\x11GetInsightRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"recommender.googleapis.com/Insight\"\x88\x02\n\x1aMarkInsightAcceptedRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"recommender.googleapis.com/Insight\x12g\n\x0estate_metadata\x18\x02 \x03(\x0b\x32J.google.cloud.recommender.v1.MarkInsightAcceptedRequest.StateMetadataEntryB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9d\x01\n\x1aListRecommendationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&recommender.googleapis.com/Recommender\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\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"|\n\x1bListRecommendationsResponse\x12\x44\n\x0frecommendations\x18\x01 \x03(\x0b\x32+.google.cloud.recommender.v1.Recommendation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"[\n\x18GetRecommendationRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\"s\n\"MarkRecommendationDismissedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"\x96\x02\n MarkRecommendationClaimedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12h\n\x0estate_metadata\x18\x02 \x03(\x0b\x32P.google.cloud.recommender.v1.MarkRecommendationClaimedRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9a\x02\n\"MarkRecommendationSucceededRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12j\n\x0estate_metadata\x18\x02 \x03(\x0b\x32R.google.cloud.recommender.v1.MarkRecommendationSucceededRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x02\n\x1fMarkRecommendationFailedRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)recommender.googleapis.com/Recommendation\x12g\n\x0estate_metadata\x18\x02 \x03(\x0b\x32O.google.cloud.recommender.v1.MarkRecommendationFailedRequest.StateMetadataEntry\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x34\n\x12StateMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"a\n\x1bGetRecommenderConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,recommender.googleapis.com/RecommenderConfig\"\xb9\x01\n\x1eUpdateRecommenderConfigRequest\x12O\n\x12recommender_config\x18\x01 \x01(\x0b\x32..google.cloud.recommender.v1.RecommenderConfigB\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\"a\n\x1bGetInsightTypeConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,recommender.googleapis.com/InsightTypeConfig\"\xba\x01\n\x1eUpdateInsightTypeConfigRequest\x12P\n\x13insight_type_config\x18\x01 \x01(\x0b\x32..google.cloud.recommender.v1.InsightTypeConfigB\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\x32\xd6.\n\x0bRecommender\x12\x8b\x03\n\x0cListInsights\x12\x30.google.cloud.recommender.v1.ListInsightsRequest\x1a\x31.google.cloud.recommender.v1.ListInsightsResponse\"\x95\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x85\x02\x12;/v1/{parent=projects/*/locations/*/insightTypes/*}/insightsZD\x12\x42/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insightsZ<\x12:/v1/{parent=folders/*/locations/*/insightTypes/*}/insightsZB\x12@/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights\x12\xf8\x02\n\nGetInsight\x12..google.cloud.recommender.v1.GetInsightRequest\x1a$.google.cloud.recommender.v1.Insight\"\x93\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x85\x02\x12;/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}ZD\x12\x42/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}Z<\x12:/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}ZB\x12@/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}\x12\xde\x03\n\x13MarkInsightAccepted\x12\x37.google.cloud.recommender.v1.MarkInsightAcceptedRequest\x1a$.google.cloud.recommender.v1.Insight\"\xe7\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xc5\x02\"H/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZT\"O/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZL\"G/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*ZR\"M/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted:\x01*\x12\xcc\x03\n\x13ListRecommendations\x12\x37.google.cloud.recommender.v1.ListRecommendationsRequest\x1a\x38.google.cloud.recommender.v1.ListRecommendationsResponse\"\xc1\x02\xda\x41\x06parent\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02\xa1\x02\x12\x42/v1/{parent=projects/*/locations/*/recommenders/*}/recommendationsZK\x12I/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendationsZC\x12\x41/v1/{parent=folders/*/locations/*/recommenders/*}/recommendationsZI\x12G/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations\x12\xa9\x03\n\x11GetRecommendation\x12\x35.google.cloud.recommender.v1.GetRecommendationRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xaf\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa1\x02\x12\x42/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}ZK\x12I/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}ZC\x12\x41/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}ZI\x12G/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}\x12\xfa\x03\n\x1bMarkRecommendationDismissed\x12?.google.cloud.recommender.v1.MarkRecommendationDismissedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xec\x02\x82\xd3\xe4\x93\x02\xe5\x02\"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*Z\\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*ZT\"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*ZZ\"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markDismissed:\x01*\x12\x89\x04\n\x19MarkRecommendationClaimed\x12=.google.cloud.recommender.v1.MarkRecommendationClaimedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xff\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xdd\x02\"N/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZZ\"U/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZR\"M/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*ZX\"S/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed:\x01*\x12\x95\x04\n\x1bMarkRecommendationSucceeded\x12?.google.cloud.recommender.v1.MarkRecommendationSucceededRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\x87\x03\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xe5\x02\"P/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*Z\\\"W/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*ZT\"O/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*ZZ\"U/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded:\x01*\x12\x83\x04\n\x18MarkRecommendationFailed\x12<.google.cloud.recommender.v1.MarkRecommendationFailedRequest\x1a+.google.cloud.recommender.v1.Recommendation\"\xfb\x02\xda\x41\x18name,state_metadata,etag\x82\xd3\xe4\x93\x02\xd9\x02\"M/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZY\"T/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZQ\"L/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*ZW\"R/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed:\x01*\x12\xcc\x02\n\x14GetRecommenderConfig\x12\x38.google.cloud.recommender.v1.GetRecommenderConfigRequest\x1a..google.cloud.recommender.v1.RecommenderConfig\"\xc9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbb\x01\x12\x37/v1/{name=projects/*/locations/*/recommenders/*/config}Z>\x12/v1/{name=billingAccounts/*/locations/*/recommenders/*/config}\x12\xe1\x03\n\x17UpdateRecommenderConfig\x12;.google.cloud.recommender.v1.UpdateRecommenderConfigRequest\x1a..google.cloud.recommender.v1.RecommenderConfig\"\xd8\x02\xda\x41\x1erecommender_config,update_mask\x82\xd3\xe4\x93\x02\xb0\x02\x32J/v1/{recommender_config.name=projects/*/locations/*/recommenders/*/config}:\x12recommender_configZe2O/v1/{recommender_config.name=organizations/*/locations/*/recommenders/*/config}:\x12recommender_configZg2Q/v1/{recommender_config.name=billingAccounts/*/locations/*/recommenders/*/config}:\x12recommender_config\x12\xcc\x02\n\x14GetInsightTypeConfig\x12\x38.google.cloud.recommender.v1.GetInsightTypeConfigRequest\x1a..google.cloud.recommender.v1.InsightTypeConfig\"\xc9\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xbb\x01\x12\x37/v1/{name=projects/*/locations/*/insightTypes/*/config}Z>\x12/v1/{name=billingAccounts/*/locations/*/insightTypes/*/config}\x12\xe8\x03\n\x17UpdateInsightTypeConfig\x12;.google.cloud.recommender.v1.UpdateInsightTypeConfigRequest\x1a..google.cloud.recommender.v1.InsightTypeConfig\"\xdf\x02\xda\x41\x1finsight_type_config,update_mask\x82\xd3\xe4\x93\x02\xb6\x02\x32K/v1/{insight_type_config.name=projects/*/locations/*/insightTypes/*/config}:\x13insight_type_configZg2P/v1/{insight_type_config.name=organizations/*/locations/*/insightTypes/*/config}:\x13insight_type_configZi2R/v1/{insight_type_config.name=billingAccounts/*/locations/*/insightTypes/*/config}:\x13insight_type_config\x1aN\xca\x41\x1arecommender.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9d\x01\n\x1f\x63om.google.cloud.recommender.v1B\x10RecommenderProtoP\x01ZAcloud.google.com/go/recommender/apiv1/recommenderpb;recommenderpb\xa2\x02\x04\x43REC\xaa\x02\x1bGoogle.Cloud.Recommender.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.recommender.v1.Insight", "google/cloud/recommender/v1/insight.proto"], - ["google.cloud.recommender.v1.Recommendation", "google/cloud/recommender/v1/recommendation.proto"], - ["google.cloud.recommender.v1.RecommenderConfig", "google/cloud/recommender/v1/recommender_config.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.recommender.v1.InsightTypeConfig", "google/cloud/recommender/v1/insight_type_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 Recommender - module V1 - ListInsightsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsRequest").msgclass - ListInsightsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsResponse").msgclass - GetInsightRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetInsightRequest").msgclass - MarkInsightAcceptedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkInsightAcceptedRequest").msgclass - ListRecommendationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsRequest").msgclass - ListRecommendationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsResponse").msgclass - GetRecommendationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetRecommendationRequest").msgclass - MarkRecommendationDismissedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationDismissedRequest").msgclass - MarkRecommendationClaimedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationClaimedRequest").msgclass - MarkRecommendationSucceededRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationSucceededRequest").msgclass - MarkRecommendationFailedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkRecommendationFailedRequest").msgclass - GetRecommenderConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetRecommenderConfigRequest").msgclass - UpdateRecommenderConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.UpdateRecommenderConfigRequest").msgclass - GetInsightTypeConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetInsightTypeConfigRequest").msgclass - UpdateInsightTypeConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.UpdateInsightTypeConfigRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb deleted file mode 100644 index d206d50c37f0..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/recommender/v1/recommender_service.proto for package 'google.cloud.recommender.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/recommender/v1/recommender_service_pb' - -module Google - module Cloud - module Recommender - module V1 - module Recommender - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.recommender.v1.Recommender' - - # Lists insights for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified insight type. - rpc :ListInsights, ::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Google::Cloud::Recommender::V1::ListInsightsResponse - # Gets the requested insight. Requires the recommender.*.get IAM permission - # for the specified insight type. - rpc :GetInsight, ::Google::Cloud::Recommender::V1::GetInsightRequest, ::Google::Cloud::Recommender::V1::Insight - # Marks the Insight State as Accepted. Users can use this method to - # indicate to the Recommender API that they have applied some action based - # on the insight. This stops the insight content from being updated. - # - # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires - # the recommender.*.update IAM permission for the specified insight. - rpc :MarkInsightAccepted, ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Google::Cloud::Recommender::V1::Insight - # Lists recommendations for the specified Cloud Resource. Requires the - # recommender.*.list IAM permission for the specified recommender. - rpc :ListRecommendations, ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Google::Cloud::Recommender::V1::ListRecommendationsResponse - # Gets the requested recommendation. Requires the recommender.*.get - # IAM permission for the specified recommender. - rpc :GetRecommendation, ::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Google::Cloud::Recommender::V1::Recommendation - # Mark the Recommendation State as Dismissed. Users can use this method to - # indicate to the Recommender API that an ACTIVE recommendation has to - # be marked back as DISMISSED. - # - # MarkRecommendationDismissed can be applied to recommendations in ACTIVE - # state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - rpc :MarkRecommendationDismissed, ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, ::Google::Cloud::Recommender::V1::Recommendation - # Marks the Recommendation State as Claimed. Users can use this method to - # indicate to the Recommender API that they are starting to apply the - # recommendation themselves. This stops the recommendation content from being - # updated. Associated insights are frozen and placed in the ACCEPTED state. - # - # MarkRecommendationClaimed can be applied to recommendations in CLAIMED, - # SUCCEEDED, FAILED, or ACTIVE state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - rpc :MarkRecommendationClaimed, ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Google::Cloud::Recommender::V1::Recommendation - # Marks the Recommendation State as Succeeded. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation was successful. This stops the recommendation - # content from being updated. Associated insights are frozen and placed in - # the ACCEPTED state. - # - # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - rpc :MarkRecommendationSucceeded, ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Google::Cloud::Recommender::V1::Recommendation - # Marks the Recommendation State as Failed. Users can use this method to - # indicate to the Recommender API that they have applied the recommendation - # themselves, and the operation failed. This stops the recommendation content - # from being updated. Associated insights are frozen and placed in the - # ACCEPTED state. - # - # MarkRecommendationFailed can be applied to recommendations in ACTIVE, - # CLAIMED, SUCCEEDED, or FAILED state. - # - # Requires the recommender.*.update IAM permission for the specified - # recommender. - rpc :MarkRecommendationFailed, ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Google::Cloud::Recommender::V1::Recommendation - # Gets the requested Recommender Config. There is only one instance of the - # config for each Recommender. - rpc :GetRecommenderConfig, ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Google::Cloud::Recommender::V1::RecommenderConfig - # Updates a Recommender Config. This will create a new revision of the - # config. - rpc :UpdateRecommenderConfig, ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Google::Cloud::Recommender::V1::RecommenderConfig - # Gets the requested InsightTypeConfig. There is only one instance of the - # config for each InsightType. - rpc :GetInsightTypeConfig, ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Google::Cloud::Recommender::V1::InsightTypeConfig - # Updates an InsightTypeConfig change. This will create a new revision of the - # config. - rpc :UpdateInsightTypeConfig, ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Google::Cloud::Recommender::V1::InsightTypeConfig - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb deleted file mode 100644 index a4ce8867fabd..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/recommender/v1/recommender/rest" -require "google/cloud/recommender/v1/version" - -module Google - module Cloud - module Recommender - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/recommender/v1/rest" - # client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb b/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/version.rb deleted file mode 100644 index 43f0a0e7df27..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/lib/google/cloud/recommender/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 Recommender - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md deleted file mode 100644 index 32f98e203c92..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Recommender 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-recommender-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb deleted file mode 100644 index faab3cdb52fd..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - # An insight along with the information used to derive the insight. The insight - # may have associated recommendations as well. - # @!attribute [rw] name - # @return [::String] - # Name of the insight. - # @!attribute [rw] description - # @return [::String] - # Free-form human readable summary in English. The maximum length is 500 - # characters. - # @!attribute [rw] target_resources - # @return [::Array<::String>] - # Fully qualified resource names that this insight is targeting. - # @!attribute [rw] insight_subtype - # @return [::String] - # Insight subtype. Insight content schema will be stable for a given subtype. - # @!attribute [rw] content - # @return [::Google::Protobuf::Struct] - # A struct of custom fields to explain the insight. - # Example: "grantedPermissionsCount": "1000" - # @!attribute [rw] last_refresh_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp of the latest data used to generate the insight. - # @!attribute [rw] observation_period - # @return [::Google::Protobuf::Duration] - # Observation period that led to the insight. The source data used to - # generate the insight ends at last_refresh_time and begins at - # (last_refresh_time - observation_period). - # @!attribute [rw] state_info - # @return [::Google::Cloud::Recommender::V1::InsightStateInfo] - # Information state and metadata. - # @!attribute [rw] category - # @return [::Google::Cloud::Recommender::V1::Insight::Category] - # Category being targeted by the insight. - # @!attribute [rw] severity - # @return [::Google::Cloud::Recommender::V1::Insight::Severity] - # Insight's severity. - # @!attribute [rw] etag - # @return [::String] - # Fingerprint of the Insight. Provides optimistic locking when updating - # states. - # @!attribute [rw] associated_recommendations - # @return [::Array<::Google::Cloud::Recommender::V1::Insight::RecommendationReference>] - # Recommendations derived from this insight. - class Insight - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reference to an associated recommendation. - # @!attribute [rw] recommendation - # @return [::String] - # Recommendation resource name, e.g. - # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] - class RecommendationReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Insight category. - module Category - # Unspecified category. - CATEGORY_UNSPECIFIED = 0 - - # The insight is related to cost. - COST = 1 - - # The insight is related to security. - SECURITY = 2 - - # The insight is related to performance. - PERFORMANCE = 3 - - # This insight is related to manageability. - MANAGEABILITY = 4 - - # The insight is related to sustainability. - SUSTAINABILITY = 5 - - # This insight is related to reliability. - RELIABILITY = 6 - end - - # Insight severity levels. - module Severity - # Insight has unspecified severity. - SEVERITY_UNSPECIFIED = 0 - - # Insight has low severity. - LOW = 1 - - # Insight has medium severity. - MEDIUM = 2 - - # Insight has high severity. - HIGH = 3 - - # Insight has critical severity. - CRITICAL = 4 - end - end - - # Information related to insight state. - # @!attribute [rw] state - # @return [::Google::Cloud::Recommender::V1::InsightStateInfo::State] - # Insight state. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of metadata for the state, provided by user or automations systems. - class InsightStateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents insight state. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # Insight is active. Content for ACTIVE insights can be updated by Google. - # ACTIVE insights can be marked DISMISSED OR ACCEPTED. - ACTIVE = 1 - - # Some action has been taken based on this insight. Insights become - # accepted when a recommendation derived from the insight has been marked - # CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked - # ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED - # insights can only be marked ACCEPTED (which may update state metadata). - ACCEPTED = 2 - - # Insight is dismissed. Content for DISMISSED insights can be updated by - # Google. DISMISSED insights can be marked as ACTIVE. - DISMISSED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb deleted file mode 100644 index b75f495146df..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/insight_type_config.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - # Configuration for an InsightType. - # @!attribute [rw] name - # @return [::String] - # Name of insight type config. - # Eg, - # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config - # @!attribute [rw] insight_type_generation_config - # @return [::Google::Cloud::Recommender::V1::InsightTypeGenerationConfig] - # InsightTypeGenerationConfig which configures the generation of - # insights for this insight type. - # @!attribute [rw] etag - # @return [::String] - # Fingerprint of the InsightTypeConfig. Provides optimistic locking when - # updating. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Last time when the config was updated. - # @!attribute [r] revision_id - # @return [::String] - # Output only. Immutable. The revision ID of the config. - # A new revision is committed whenever the config is changed in any way. - # The format is an 8-character hexadecimal string. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows clients to store small amounts of arbitrary data. Annotations must - # follow the Kubernetes syntax. - # The total size of all keys and values combined is limited to 256k. - # Key can have 2 segments: prefix (optional) and name (required), - # separated by a slash (/). - # Prefix must be a DNS subdomain. - # Name must be 63 characters or less, begin and end with alphanumerics, - # with dashes (-), underscores (_), dots (.), and alphanumerics between. - # @!attribute [rw] display_name - # @return [::String] - # A user-settable field to provide a human-readable name to be used in user - # interfaces. - class InsightTypeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A configuration to customize the generation of insights. - # Eg, customizing the lookback period considered when generating a - # insight. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameters for this InsightTypeGenerationConfig. These configs can be used - # by or are applied to all subtypes. - class InsightTypeGenerationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb deleted file mode 100644 index 86f8e1e47b4d..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommendation.rb +++ /dev/null @@ -1,442 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - # A recommendation along with a suggested action. E.g., a rightsizing - # recommendation for an underutilized VM, IAM role recommendations, etc - # @!attribute [rw] name - # @return [::String] - # Name of recommendation. - # @!attribute [rw] description - # @return [::String] - # Free-form human readable summary in English. The maximum length is 500 - # characters. - # @!attribute [rw] recommender_subtype - # @return [::String] - # Contains an identifier for a subtype of recommendations produced for the - # same recommender. Subtype is a function of content and impact, meaning a - # new subtype might be added when significant changes to `content` or - # `primary_impact.category` are introduced. See the Recommenders section - # to see a list of subtypes for a given Recommender. - # - # Examples: - # For recommender = "google.iam.policy.Recommender", - # recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" - # @!attribute [rw] last_refresh_time - # @return [::Google::Protobuf::Timestamp] - # Last time this recommendation was refreshed by the system that created it - # in the first place. - # @!attribute [rw] primary_impact - # @return [::Google::Cloud::Recommender::V1::Impact] - # The primary impact that this recommendation can have while trying to - # optimize for one category. - # @!attribute [rw] additional_impact - # @return [::Array<::Google::Cloud::Recommender::V1::Impact>] - # Optional set of additional impact that this recommendation may have when - # trying to optimize for the primary category. These may be positive - # or negative. - # @!attribute [rw] priority - # @return [::Google::Cloud::Recommender::V1::Recommendation::Priority] - # Recommendation's priority. - # @!attribute [rw] content - # @return [::Google::Cloud::Recommender::V1::RecommendationContent] - # Content of the recommendation describing recommended changes to resources. - # @!attribute [rw] state_info - # @return [::Google::Cloud::Recommender::V1::RecommendationStateInfo] - # Information for state. Contains state and metadata. - # @!attribute [rw] etag - # @return [::String] - # Fingerprint of the Recommendation. Provides optimistic locking when - # updating states. - # @!attribute [rw] associated_insights - # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation::InsightReference>] - # Insights that led to this recommendation. - # @!attribute [rw] xor_group_id - # @return [::String] - # Corresponds to a mutually exclusive group ID within a recommender. - # A non-empty ID indicates that the recommendation belongs to a mutually - # exclusive group. This means that only one recommendation within the group - # is suggested to be applied. - class Recommendation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reference to an associated insight. - # @!attribute [rw] insight - # @return [::String] - # Insight resource name, e.g. - # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] - class InsightReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Recommendation priority levels. - module Priority - # Recommendation has unspecified priority. - PRIORITY_UNSPECIFIED = 0 - - # Recommendation has P4 priority (lowest priority). - P4 = 1 - - # Recommendation has P3 priority (second lowest priority). - P3 = 2 - - # Recommendation has P2 priority (second highest priority). - P2 = 3 - - # Recommendation has P1 priority (highest priority). - P1 = 4 - end - end - - # Contains what resources are changing and how they are changing. - # @!attribute [rw] operation_groups - # @return [::Array<::Google::Cloud::Recommender::V1::OperationGroup>] - # Operations to one or more Google Cloud resources grouped in such a way - # that, all operations within one group are expected to be performed - # atomically and in an order. - # @!attribute [rw] overview - # @return [::Google::Protobuf::Struct] - # Condensed overview information about the recommendation. - class RecommendationContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Group of operations that need to be performed atomically. - # @!attribute [rw] operations - # @return [::Array<::Google::Cloud::Recommender::V1::Operation>] - # List of operations across one or more resources that belong to this group. - # Loosely based on RFC6902 and should be performed in the order they appear. - class OperationGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains an operation for a resource loosely based on the JSON-PATCH format - # with support for: - # - # * Custom filters for describing partial array patch. - # * Extended path values for describing nested arrays. - # * Custom fields for describing the resource for which the operation is being - # described. - # * Allows extension to custom operations not natively supported by RFC6902. - # See https://tools.ietf.org/html/rfc6902 for details on the original RFC. - # @!attribute [rw] action - # @return [::String] - # Type of this operation. Contains one of 'add', 'remove', 'replace', 'move', - # 'copy', 'test' and custom operations. This field is case-insensitive and - # always populated. - # @!attribute [rw] resource_type - # @return [::String] - # Type of GCP resource being modified/tested. This field is always populated. - # Example: cloudresourcemanager.googleapis.com/Project, - # compute.googleapis.com/Instance - # @!attribute [rw] resource - # @return [::String] - # Contains the fully qualified resource name. This field is always populated. - # ex: //cloudresourcemanager.googleapis.com/projects/foo. - # @!attribute [rw] path - # @return [::String] - # Path to the target field being operated on. If the operation is at the - # resource level, then path should be "/". This field is always populated. - # @!attribute [rw] source_resource - # @return [::String] - # Can be set with action 'copy' to copy resource configuration across - # different resources of the same type. Example: A resource clone can be - # done via action = 'copy', path = "/", from = "/", - # source_resource = and resource_name = . - # This field is empty for all other values of `action`. - # @!attribute [rw] source_path - # @return [::String] - # Can be set with action 'copy' or 'move' to indicate the source field within - # resource or source_resource, ignored if provided for other operation types. - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - # Value for the `path` field. Will be set for actions:'add'/'replace'. - # Maybe set for action: 'test'. Either this or `value_matcher` will be set - # for 'test' operation. An exact match must be performed. - # - # Note: The following fields are mutually exclusive: `value`, `value_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] value_matcher - # @return [::Google::Cloud::Recommender::V1::ValueMatcher] - # Can be set for action 'test' for advanced matching for the value of - # 'path' field. Either this or `value` will be set for 'test' operation. - # - # Note: The following fields are mutually exclusive: `value_matcher`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] path_filters - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Set of filters to apply if `path` refers to array elements or nested array - # elements in order to narrow down to a single unique element that is being - # tested/modified. - # This is intended to be an exact match per filter. To perform advanced - # matching, use path_value_matchers. - # - # * Example: - # ``` - # { - # "/versions/*/name" : "it-123" - # "/versions/*/targetSize/percent": 20 - # } - # ``` - # * Example: - # ``` - # { - # "/bindings/*/role": "roles/owner" - # "/bindings/*/condition" : null - # } - # ``` - # * Example: - # ``` - # { - # "/bindings/*/role": "roles/owner" - # "/bindings/*/members/*" : ["x@example.com", "y@example.com"] - # } - # ``` - # When both path_filters and path_value_matchers are set, an implicit AND - # must be performed. - # @!attribute [rw] path_value_matchers - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Recommender::V1::ValueMatcher}] - # Similar to path_filters, this contains set of filters to apply if `path` - # field refers to array elements. This is meant to support value matching - # beyond exact match. To perform exact match, use path_filters. - # When both path_filters and path_value_matchers are set, an implicit AND - # must be performed. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class PathFiltersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Recommender::V1::ValueMatcher] - class PathValueMatchersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains various matching options for values for a GCP resource field. - # @!attribute [rw] matches_pattern - # @return [::String] - # To be used for full regex matching. The regular expression is using the - # Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be - # used with RE2::FullMatch - class ValueMatcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains metadata about how much money a recommendation can save or incur. - # @!attribute [rw] cost - # @return [::Google::Type::Money] - # An approximate projection on amount saved or amount incurred. Negative cost - # units indicate cost savings and positive cost units indicate increase. - # See google.type.Money documentation for positive/negative units. - # - # A user's permissions may affect whether the cost is computed using list - # prices or custom contract prices. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration for which this cost applies. - # @!attribute [rw] cost_in_local_currency - # @return [::Google::Type::Money] - # The approximate cost savings in the billing account's local currency. - class CostProjection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains various ways of describing the impact on Security. - # @!attribute [rw] details - # @return [::Google::Protobuf::Struct] - # Additional security impact details that is provided by the recommender. - class SecurityProjection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains metadata about how much sustainability a recommendation can save or - # incur. - # @!attribute [rw] kg_c_o2e - # @return [::Float] - # Carbon Footprint generated in kg of CO2 equivalent. - # Chose kg_c_o2e so that the name renders correctly in camelCase (kgCO2e). - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration for which this sustainability applies. - class SustainabilityProjection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information on the impact of a reliability recommendation. - # @!attribute [rw] risks - # @return [::Array<::Google::Cloud::Recommender::V1::ReliabilityProjection::RiskType>] - # Reliability risks mitigated by this recommendation. - # @!attribute [rw] details - # @return [::Google::Protobuf::Struct] - # Per-recommender projection. - class ReliabilityProjection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The risk associated with the reliability issue. - module RiskType - # Default unspecified risk. Don't use directly. - RISK_TYPE_UNSPECIFIED = 0 - - # Potential service downtime. - SERVICE_DISRUPTION = 1 - - # Potential data loss. - DATA_LOSS = 2 - - # Potential access denial. The service is still up but some or all clients - # can't access it. - ACCESS_DENY = 3 - end - end - - # Contains the impact a recommendation can have for a given category. - # @!attribute [rw] category - # @return [::Google::Cloud::Recommender::V1::Impact::Category] - # Category that is being targeted. - # @!attribute [rw] cost_projection - # @return [::Google::Cloud::Recommender::V1::CostProjection] - # Use with CategoryType.COST - # - # Note: The following fields are mutually exclusive: `cost_projection`, `security_projection`, `sustainability_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] security_projection - # @return [::Google::Cloud::Recommender::V1::SecurityProjection] - # Use with CategoryType.SECURITY - # - # Note: The following fields are mutually exclusive: `security_projection`, `cost_projection`, `sustainability_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sustainability_projection - # @return [::Google::Cloud::Recommender::V1::SustainabilityProjection] - # Use with CategoryType.SUSTAINABILITY - # - # Note: The following fields are mutually exclusive: `sustainability_projection`, `cost_projection`, `security_projection`, `reliability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reliability_projection - # @return [::Google::Cloud::Recommender::V1::ReliabilityProjection] - # Use with CategoryType.RELIABILITY - # - # Note: The following fields are mutually exclusive: `reliability_projection`, `cost_projection`, `security_projection`, `sustainability_projection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Impact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The category of the impact. - module Category - # Default unspecified category. Don't use directly. - CATEGORY_UNSPECIFIED = 0 - - # Indicates a potential increase or decrease in cost. - COST = 1 - - # Indicates a potential increase or decrease in security. - SECURITY = 2 - - # Indicates a potential increase or decrease in performance. - PERFORMANCE = 3 - - # Indicates a potential increase or decrease in manageability. - MANAGEABILITY = 4 - - # Indicates a potential increase or decrease in sustainability. - SUSTAINABILITY = 5 - - # Indicates a potential increase or decrease in reliability. - RELIABILITY = 6 - end - end - - # Information for state. Contains state and metadata. - # @!attribute [rw] state - # @return [::Google::Cloud::Recommender::V1::RecommendationStateInfo::State] - # The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of metadata for the state, provided by user or automations systems. - class RecommendationStateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents Recommendation State. - module State - # Default state. Don't use directly. - STATE_UNSPECIFIED = 0 - - # Recommendation is active and can be applied. Recommendations content can - # be updated by Google. - # - # ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - ACTIVE = 1 - - # Recommendation is in claimed state. Recommendations content is - # immutable and cannot be updated by Google. - # - # CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. - CLAIMED = 6 - - # Recommendation is in succeeded state. Recommendations content is - # immutable and cannot be updated by Google. - # - # SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. - SUCCEEDED = 3 - - # Recommendation is in failed state. Recommendations content is immutable - # and cannot be updated by Google. - # - # FAILED recommendations can be marked as SUCCEEDED, or FAILED. - FAILED = 4 - - # Recommendation is in dismissed state. Recommendation content can be - # updated by Google. - # - # DISMISSED recommendations can be marked as ACTIVE. - DISMISSED = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb deleted file mode 100644 index c0dfde01256c..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_config.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - # Configuration for a Recommender. - # @!attribute [rw] name - # @return [::String] - # Name of recommender config. - # Eg, - # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config - # @!attribute [rw] recommender_generation_config - # @return [::Google::Cloud::Recommender::V1::RecommenderGenerationConfig] - # RecommenderGenerationConfig which configures the Generation of - # recommendations for this recommender. - # @!attribute [rw] etag - # @return [::String] - # Fingerprint of the RecommenderConfig. Provides optimistic locking when - # updating. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Last time when the config was updated. - # @!attribute [r] revision_id - # @return [::String] - # Output only. Immutable. The revision ID of the config. - # A new revision is committed whenever the config is changed in any way. - # The format is an 8-character hexadecimal string. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Allows clients to store small amounts of arbitrary data. Annotations must - # follow the Kubernetes syntax. - # The total size of all keys and values combined is limited to 256k. - # Key can have 2 segments: prefix (optional) and name (required), - # separated by a slash (/). - # Prefix must be a DNS subdomain. - # Name must be 63 characters or less, begin and end with alphanumerics, - # with dashes (-), underscores (_), dots (.), and alphanumerics between. - # @!attribute [rw] display_name - # @return [::String] - # A user-settable field to provide a human-readable name to be used in user - # interfaces. - class RecommenderConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Configuration to customize the generation of recommendations. - # Eg, customizing the lookback period considered when generating a - # recommendation. - # @!attribute [rw] params - # @return [::Google::Protobuf::Struct] - # Parameters for this RecommenderGenerationConfig. These configs can be used - # by or are applied to all subtypes. - class RecommenderGenerationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb deleted file mode 100644 index bb413762f92f..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/cloud/recommender/v1/recommender_service.rb +++ /dev/null @@ -1,390 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Recommender - module V1 - # Request for the `ListInsights` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # INSIGHT_TYPE_ID refers to supported insight types: - # https://cloud.google.com/recommender/docs/insights/insight-types. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter expression to restrict the insights returned. Supported - # filter fields: - # - # * `stateInfo.state` - # - # * `insightSubtype` - # - # * `severity` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `insightSubtype = PERMISSIONS_USAGE` - # - # * `severity = CRITICAL OR severity = HIGH` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - class ListInsightsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to the `ListInsights` method. - # @!attribute [rw] insights - # @return [::Array<::Google::Cloud::Recommender::V1::Insight>] - # The set of insights for the `parent` resource. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be used to request the next page of results. This field is - # empty if there are no additional results. - class ListInsightsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to the `GetInsight` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the insight. - class GetInsightRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `MarkInsightAccepted` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the insight. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. State properties user wish to include with this state. Full - # replace of the current state_metadata. - # @!attribute [rw] etag - # @return [::String] - # Required. Fingerprint of the Insight. Provides optimistic locking. - class MarkInsightAcceptedRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the `ListRecommendations` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The container resource on which to execute the request. - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` - # - # LOCATION here refers to GCP Locations: - # https://cloud.google.com/about/locations/ - # RECOMMENDER_ID refers to supported recommenders: - # https://cloud.google.com/recommender/docs/recommenders. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return from this request. - # Non-positive values are ignored. If not specified, the server will - # determine the number of results to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. If present, retrieves the next batch of results from the - # preceding call to this method. `page_token` must be the value of - # `next_page_token` from the previous response. The values of other method - # parameters must be identical to those in the previous call. - # @!attribute [rw] filter - # @return [::String] - # Filter expression to restrict the recommendations returned. Supported - # filter fields: - # - # * `state_info.state` - # - # * `recommenderSubtype` - # - # * `priority` - # - # * `targetResources` - # - # Examples: - # - # * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED` - # - # * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE` - # - # * `priority = P1 OR priority = P2` - # - # * `targetResources : - # //compute.googleapis.com/projects/1234/zones/us-central1-a/instances/instance-1` - # - # * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)` - # - # The max allowed filter length is 500 characters. - # - # (These expressions are based on the filter language described at - # https://google.aip.dev/160) - class ListRecommendationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to the `ListRecommendations` method. - # @!attribute [rw] recommendations - # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation>] - # The set of recommendations for the `parent` resource. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be used to request the next page of results. This field is - # empty if there are no additional results. - class ListRecommendationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to the `GetRecommendation` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the recommendation. - class GetRecommendationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `MarkRecommendationDismissed` Method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the recommendation. - # @!attribute [rw] etag - # @return [::String] - # Fingerprint of the Recommendation. Provides optimistic locking. - class MarkRecommendationDismissedRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `MarkRecommendationClaimed` Method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the recommendation. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @!attribute [rw] etag - # @return [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - class MarkRecommendationClaimedRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the `MarkRecommendationSucceeded` Method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the recommendation. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @!attribute [rw] etag - # @return [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - class MarkRecommendationSucceededRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the `MarkRecommendationFailed` Method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the recommendation. - # @!attribute [rw] state_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # State properties to include with this state. Overwrites any existing - # `state_metadata`. - # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`. - # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`. - # @!attribute [rw] etag - # @return [::String] - # Required. Fingerprint of the Recommendation. Provides optimistic locking. - class MarkRecommendationFailedRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class StateMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the GetRecommenderConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the Recommendation Config to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` - class GetRecommenderConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `UpdateRecommenderConfig` method. - # @!attribute [rw] recommender_config - # @return [::Google::Cloud::Recommender::V1::RecommenderConfig] - # Required. The RecommenderConfig to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - class UpdateRecommenderConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the GetInsightTypeConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the InsightTypeConfig to get. - # - # Acceptable formats: - # - # * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - # - # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` - class GetInsightTypeConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `UpdateInsightTypeConfig` method. - # @!attribute [rw] insight_type_config - # @return [::Google::Cloud::Recommender::V1::InsightTypeConfig] - # Required. The InsightTypeConfig to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # If true, validate the request and preview the change, but do not actually - # update it. - class UpdateInsightTypeConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.rb deleted file mode 100644 index 56a32eee300d..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/proto_docs/google/type/money.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 Type - # Represents an amount of money with its currency type. - # @!attribute [rw] currency_code - # @return [::String] - # The three-letter currency code defined in ISO 4217. - # @!attribute [rw] units - # @return [::Integer] - # The whole units of the amount. - # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - # @!attribute [rw] nanos - # @return [::Integer] - # Number of nano (10^-9) units of the amount. - # The value must be between -999,999,999 and +999,999,999 inclusive. - # If `units` is positive, `nanos` must be positive or zero. - # If `units` is zero, `nanos` can be positive, zero, or negative. - # If `units` is negative, `nanos` must be negative or zero. - # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - class Money - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-recommender-v1/snippets/Gemfile deleted file mode 100644 index 18e10c392f62..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender-v1", path: "../" -else - gem "google-cloud-recommender-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-recommender-v1/snippets/recommender/get_insight.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb deleted file mode 100644 index 2cfd5ef432f3..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_GetInsight_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the get_insight call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#get_insight. -# -def get_insight - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::GetInsightRequest.new - - # Call the get_insight method. - result = client.get_insight request - - # The returned object is of type Google::Cloud::Recommender::V1::Insight. - p result -end -# [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb deleted file mode 100644 index 1ced3f4d6e9b..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_insight_type_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 recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the get_insight_type_config call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config. -# -def get_insight_type_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new - - # Call the get_insight_type_config method. - result = client.get_insight_type_config request - - # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - p result -end -# [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb deleted file mode 100644 index 2eae8783dbe3..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_GetRecommendation_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the get_recommendation call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation. -# -def get_recommendation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new - - # Call the get_recommendation method. - result = client.get_recommendation request - - # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - p result -end -# [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb deleted file mode 100644 index a2878d79cd79..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/get_recommender_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 recommender_v1_generated_Recommender_GetRecommenderConfig_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the get_recommender_config call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config. -# -def get_recommender_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new - - # Call the get_recommender_config method. - result = client.get_recommender_config request - - # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - p result -end -# [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.rb deleted file mode 100644 index 40a049765449..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_insights.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 recommender_v1_generated_Recommender_ListInsights_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the list_insights call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#list_insights. -# -def list_insights - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::ListInsightsRequest.new - - # Call the list_insights method. - result = client.list_insights request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Recommender::V1::Insight. - p item - end -end -# [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb deleted file mode 100644 index 30a00dc303d5..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/list_recommendations.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 recommender_v1_generated_Recommender_ListRecommendations_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the list_recommendations call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations. -# -def list_recommendations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new - - # Call the list_recommendations method. - result = client.list_recommendations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. - p item - end -end -# [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb deleted file mode 100644 index 54065065a346..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_MarkInsightAccepted_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the mark_insight_accepted call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted. -# -def mark_insight_accepted - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new - - # Call the mark_insight_accepted method. - result = client.mark_insight_accepted request - - # The returned object is of type Google::Cloud::Recommender::V1::Insight. - p result -end -# [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb deleted file mode 100644 index b535c53f219f..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the mark_recommendation_claimed call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed. -# -def mark_recommendation_claimed - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new - - # Call the mark_recommendation_claimed method. - result = client.mark_recommendation_claimed request - - # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - p result -end -# [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb deleted file mode 100644 index 33c84ec4f40a..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_dismissed.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the mark_recommendation_dismissed call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed. -# -def mark_recommendation_dismissed - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new - - # Call the mark_recommendation_dismissed method. - result = client.mark_recommendation_dismissed request - - # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - p result -end -# [END recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb deleted file mode 100644 index 25f123d2f151..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the mark_recommendation_failed call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed. -# -def mark_recommendation_failed - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new - - # Call the mark_recommendation_failed method. - result = client.mark_recommendation_failed request - - # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - p result -end -# [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb deleted file mode 100644 index 7d3340005fe7..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the mark_recommendation_succeeded call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded. -# -def mark_recommendation_succeeded - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new - - # Call the mark_recommendation_succeeded method. - result = client.mark_recommendation_succeeded request - - # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. - p result -end -# [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb deleted file mode 100644 index 2f072582bc10..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_insight_type_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 recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the update_insight_type_config call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config. -# -def update_insight_type_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new - - # Call the update_insight_type_config method. - result = client.update_insight_type_config request - - # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. - p result -end -# [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb b/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb deleted file mode 100644 index 0b821b23dadc..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/recommender/update_recommender_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 recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] -require "google/cloud/recommender/v1" - -## -# Snippet for the update_recommender_config call in the Recommender service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config. -# -def update_recommender_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Recommender::V1::Recommender::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new - - # Call the update_recommender_config method. - result = client.update_recommender_config request - - # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. - p result -end -# [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json b/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json deleted file mode 100644 index 6ccb7dda649f..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-recommender-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.recommender.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "recommender_v1_generated_Recommender_ListInsights_sync", - "title": "Snippet for the list_insights call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#list_insights.", - "file": "recommender/list_insights.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_insights", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#list_insights", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::ListInsightsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::ListInsightsResponse", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "ListInsights", - "full_name": "google.cloud.recommender.v1.Recommender.ListInsights", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_GetInsight_sync", - "title": "Snippet for the get_insight call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_insight.", - "file": "recommender/get_insight.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_insight", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_insight", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::GetInsightRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Insight", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "GetInsight", - "full_name": "google.cloud.recommender.v1.Recommender.GetInsight", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_MarkInsightAccepted_sync", - "title": "Snippet for the mark_insight_accepted call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted.", - "file": "recommender/mark_insight_accepted.rb", - "language": "RUBY", - "client_method": { - "short_name": "mark_insight_accepted", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Insight", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "MarkInsightAccepted", - "full_name": "google.cloud.recommender.v1.Recommender.MarkInsightAccepted", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_ListRecommendations_sync", - "title": "Snippet for the list_recommendations call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations.", - "file": "recommender/list_recommendations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_recommendations", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::ListRecommendationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::ListRecommendationsResponse", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "ListRecommendations", - "full_name": "google.cloud.recommender.v1.Recommender.ListRecommendations", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_GetRecommendation_sync", - "title": "Snippet for the get_recommendation call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation.", - "file": "recommender/get_recommendation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_recommendation", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::GetRecommendationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Recommendation", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "GetRecommendation", - "full_name": "google.cloud.recommender.v1.Recommender.GetRecommendation", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationDismissed_sync", - "title": "Snippet for the mark_recommendation_dismissed call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed.", - "file": "recommender/mark_recommendation_dismissed.rb", - "language": "RUBY", - "client_method": { - "short_name": "mark_recommendation_dismissed", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_dismissed", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Recommendation", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "MarkRecommendationDismissed", - "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationDismissed", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync", - "title": "Snippet for the mark_recommendation_claimed call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed.", - "file": "recommender/mark_recommendation_claimed.rb", - "language": "RUBY", - "client_method": { - "short_name": "mark_recommendation_claimed", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Recommendation", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "MarkRecommendationClaimed", - "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationClaimed", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync", - "title": "Snippet for the mark_recommendation_succeeded call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded.", - "file": "recommender/mark_recommendation_succeeded.rb", - "language": "RUBY", - "client_method": { - "short_name": "mark_recommendation_succeeded", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Recommendation", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "MarkRecommendationSucceeded", - "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationSucceeded", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_MarkRecommendationFailed_sync", - "title": "Snippet for the mark_recommendation_failed call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed.", - "file": "recommender/mark_recommendation_failed.rb", - "language": "RUBY", - "client_method": { - "short_name": "mark_recommendation_failed", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::Recommendation", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "MarkRecommendationFailed", - "full_name": "google.cloud.recommender.v1.Recommender.MarkRecommendationFailed", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_GetRecommenderConfig_sync", - "title": "Snippet for the get_recommender_config call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config.", - "file": "recommender/get_recommender_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_recommender_config", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::RecommenderConfig", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "GetRecommenderConfig", - "full_name": "google.cloud.recommender.v1.Recommender.GetRecommenderConfig", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync", - "title": "Snippet for the update_recommender_config call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config.", - "file": "recommender/update_recommender_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_recommender_config", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::RecommenderConfig", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "UpdateRecommenderConfig", - "full_name": "google.cloud.recommender.v1.Recommender.UpdateRecommenderConfig", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_GetInsightTypeConfig_sync", - "title": "Snippet for the get_insight_type_config call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config.", - "file": "recommender/get_insight_type_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_insight_type_config", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::InsightTypeConfig", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "GetInsightTypeConfig", - "full_name": "google.cloud.recommender.v1.Recommender.GetInsightTypeConfig", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync", - "title": "Snippet for the update_insight_type_config call in the Recommender service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config.", - "file": "recommender/update_insight_type_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_insight_type_config", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Recommender::V1::InsightTypeConfig", - "client": { - "short_name": "Recommender::Client", - "full_name": "::Google::Cloud::Recommender::V1::Recommender::Client" - }, - "method": { - "short_name": "UpdateInsightTypeConfig", - "full_name": "google.cloud.recommender.v1.Recommender.UpdateInsightTypeConfig", - "service": { - "short_name": "Recommender", - "full_name": "google.cloud.recommender.v1.Recommender" - } - } - }, - "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-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb deleted file mode 100644 index 45c9e076dd5c..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommender/v1/recommender" - -class ::Google::Cloud::Recommender::V1::Recommender::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_insight_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.insight_path project: "value0", location: "value1", insight_type: "value2", insight: "value3" - assert_equal "projects/value0/locations/value1/insightTypes/value2/insights/value3", path - - path = client.insight_path billing_account: "value0", location: "value1", insight_type: "value2", insight: "value3" - assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2/insights/value3", path - - path = client.insight_path folder: "value0", location: "value1", insight_type: "value2", insight: "value3" - assert_equal "folders/value0/locations/value1/insightTypes/value2/insights/value3", path - - path = client.insight_path organization: "value0", location: "value1", insight_type: "value2", insight: "value3" - assert_equal "organizations/value0/locations/value1/insightTypes/value2/insights/value3", path - end - end - - def test_insight_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.insight_type_path project: "value0", location: "value1", insight_type: "value2" - assert_equal "projects/value0/locations/value1/insightTypes/value2", path - - path = client.insight_type_path billing_account: "value0", location: "value1", insight_type: "value2" - assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2", path - - path = client.insight_type_path folder: "value0", location: "value1", insight_type: "value2" - assert_equal "folders/value0/locations/value1/insightTypes/value2", path - - path = client.insight_type_path organization: "value0", location: "value1", insight_type: "value2" - assert_equal "organizations/value0/locations/value1/insightTypes/value2", path - end - end - - def test_insight_type_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::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.insight_type_config_path project: "value0", location: "value1", insight_type: "value2" - assert_equal "projects/value0/locations/value1/insightTypes/value2/config", path - - path = client.insight_type_config_path organization: "value0", location: "value1", insight_type: "value2" - assert_equal "organizations/value0/locations/value1/insightTypes/value2/config", path - - path = client.insight_type_config_path billing_account: "value0", location: "value1", insight_type: "value2" - assert_equal "billingAccounts/value0/locations/value1/insightTypes/value2/config", path - end - end - - def test_recommendation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.recommendation_path project: "value0", location: "value1", recommender: "value2", recommendation: "value3" - assert_equal "projects/value0/locations/value1/recommenders/value2/recommendations/value3", path - - path = client.recommendation_path billing_account: "value0", location: "value1", recommender: "value2", recommendation: "value3" - assert_equal "billingAccounts/value0/locations/value1/recommenders/value2/recommendations/value3", path - - path = client.recommendation_path folder: "value0", location: "value1", recommender: "value2", recommendation: "value3" - assert_equal "folders/value0/locations/value1/recommenders/value2/recommendations/value3", path - - path = client.recommendation_path organization: "value0", location: "value1", recommender: "value2", recommendation: "value3" - assert_equal "organizations/value0/locations/value1/recommenders/value2/recommendations/value3", path - end - end - - def test_recommender_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.recommender_path project: "value0", location: "value1", recommender: "value2" - assert_equal "projects/value0/locations/value1/recommenders/value2", path - - path = client.recommender_path billing_account: "value0", location: "value1", recommender: "value2" - assert_equal "billingAccounts/value0/locations/value1/recommenders/value2", path - - path = client.recommender_path folder: "value0", location: "value1", recommender: "value2" - assert_equal "folders/value0/locations/value1/recommenders/value2", path - - path = client.recommender_path organization: "value0", location: "value1", recommender: "value2" - assert_equal "organizations/value0/locations/value1/recommenders/value2", path - end - end - - def test_recommender_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::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.recommender_config_path project: "value0", location: "value1", recommender: "value2" - assert_equal "projects/value0/locations/value1/recommenders/value2/config", path - - path = client.recommender_config_path organization: "value0", location: "value1", recommender: "value2" - assert_equal "organizations/value0/locations/value1/recommenders/value2/config", path - - path = client.recommender_config_path billing_account: "value0", location: "value1", recommender: "value2" - assert_equal "billingAccounts/value0/locations/value1/recommenders/value2/config", path - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb deleted file mode 100644 index b8d581c7dd1c..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb +++ /dev/null @@ -1,820 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/recommender/v1/recommender_service_pb" -require "google/cloud/recommender/v1/recommender/rest" - - -class ::Google::Cloud::Recommender::V1::Recommender::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_insights - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::ListInsightsResponse.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_insights_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_list_insights_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_insights_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_insights({ 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_insights 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_insights ::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights({ 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_insights(::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights_client_stub.call_count - end - end - end - - def test_get_insight - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Insight.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_insight_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_insight_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_insight_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_insight({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_insight name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_insight ::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_insight({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_insight(::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_insight_client_stub.call_count - end - end - end - - def test_mark_insight_accepted - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Insight.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_insight_accepted_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_insight_accepted_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mark_insight_accepted_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mark_insight_accepted name: name, state_metadata: state_metadata, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mark_insight_accepted ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mark_insight_accepted(::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mark_insight_accepted_client_stub.call_count - end - end - end - - def test_list_recommendations - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.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_recommendations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_list_recommendations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_recommendations_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_recommendations({ 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_recommendations 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_recommendations ::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations({ 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_recommendations(::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations_client_stub.call_count - end - end - end - - def test_get_recommendation - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Recommendation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recommendation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_recommendation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_recommendation_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_recommendation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_recommendation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_recommendation ::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_recommendation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_recommendation(::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_recommendation_client_stub.call_count - end - end - end - - def test_mark_recommendation_dismissed - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Recommendation.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" - - mark_recommendation_dismissed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_dismissed_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mark_recommendation_dismissed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mark_recommendation_dismissed({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mark_recommendation_dismissed name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mark_recommendation_dismissed ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mark_recommendation_dismissed({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mark_recommendation_dismissed(::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mark_recommendation_dismissed_client_stub.call_count - end - end - end - - def test_mark_recommendation_claimed - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Recommendation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_claimed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_claimed_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mark_recommendation_claimed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mark_recommendation_claimed name: name, state_metadata: state_metadata, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mark_recommendation_claimed ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mark_recommendation_claimed(::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mark_recommendation_claimed_client_stub.call_count - end - end - end - - def test_mark_recommendation_succeeded - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Recommendation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_succeeded_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_succeeded_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mark_recommendation_succeeded_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mark_recommendation_succeeded name: name, state_metadata: state_metadata, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mark_recommendation_succeeded ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mark_recommendation_succeeded(::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mark_recommendation_succeeded_client_stub.call_count - end - end - end - - def test_mark_recommendation_failed - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::Recommendation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_failed_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_mark_recommendation_failed_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, mark_recommendation_failed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.mark_recommendation_failed name: name, state_metadata: state_metadata, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.mark_recommendation_failed ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.mark_recommendation_failed(::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, mark_recommendation_failed_client_stub.call_count - end - end - end - - def test_get_recommender_config - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::RecommenderConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recommender_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_recommender_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_recommender_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_recommender_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_recommender_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_recommender_config ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_recommender_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_recommender_config(::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_recommender_config_client_stub.call_count - end - end - end - - def test_update_recommender_config - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::RecommenderConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - recommender_config = {} - update_mask = {} - validate_only = true - - update_recommender_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_update_recommender_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_recommender_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_recommender_config recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_recommender_config ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, 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_recommender_config({ recommender_config: recommender_config, 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_recommender_config(::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, 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_recommender_config_client_stub.call_count - end - end - end - - def test_get_insight_type_config - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_insight_type_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_get_insight_type_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_insight_type_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_insight_type_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_insight_type_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_insight_type_config ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_insight_type_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_insight_type_config(::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_insight_type_config_client_stub.call_count - end - end - end - - def test_update_insight_type_config - # Create test objects. - client_result = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - insight_type_config = {} - update_mask = {} - validate_only = true - - update_insight_type_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::Recommender::V1::Recommender::Rest::ServiceStub.stub :transcode_update_insight_type_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_insight_type_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_insight_type_config insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_insight_type_config ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, 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_insight_type_config({ insight_type_config: insight_type_config, 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_insight_type_config(::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, 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_insight_type_config_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Recommender::V1::Recommender::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::Recommender::V1::Recommender::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb b/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb deleted file mode 100644 index c6f954bb2c50..000000000000 --- a/owl-bot-staging/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb +++ /dev/null @@ -1,906 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/recommender/v1/recommender_service_pb" -require "google/cloud/recommender/v1/recommender" - -class ::Google::Cloud::Recommender::V1::Recommender::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_insights - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::ListInsightsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_insights_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_insights, name - assert_kind_of ::Google::Cloud::Recommender::V1::ListInsightsRequest, 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_insights_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_insights({ 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_insights 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_insights ::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights({ 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_insights(::Google::Cloud::Recommender::V1::ListInsightsRequest.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_insights_client_stub.call_rpc_count - end - end - - def test_get_insight - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Insight.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_insight_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_insight, name - assert_kind_of ::Google::Cloud::Recommender::V1::GetInsightRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_insight_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_insight({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_insight name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_insight ::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_insight({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_insight(::Google::Cloud::Recommender::V1::GetInsightRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_insight_client_stub.call_rpc_count - end - end - - def test_mark_insight_accepted - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Insight.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_insight_accepted_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mark_insight_accepted, name - assert_kind_of ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, request - assert_equal "hello world", request["name"] - assert_equal({}, request["state_metadata"].to_h) - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mark_insight_accepted_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mark_insight_accepted name: name, state_metadata: state_metadata, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mark_insight_accepted ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mark_insight_accepted({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mark_insight_accepted(::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mark_insight_accepted_client_stub.call_rpc_count - end - end - - def test_list_recommendations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::ListRecommendationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_recommendations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_recommendations, name - assert_kind_of ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, 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_recommendations_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_recommendations({ 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_recommendations 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_recommendations ::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations({ 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_recommendations(::Google::Cloud::Recommender::V1::ListRecommendationsRequest.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_recommendations_client_stub.call_rpc_count - end - end - - def test_get_recommendation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recommendation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_recommendation, name - assert_kind_of ::Google::Cloud::Recommender::V1::GetRecommendationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_recommendation_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_recommendation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_recommendation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_recommendation ::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_recommendation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_recommendation(::Google::Cloud::Recommender::V1::GetRecommendationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_recommendation_client_stub.call_rpc_count - end - end - - def test_mark_recommendation_dismissed - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - mark_recommendation_dismissed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mark_recommendation_dismissed, name - assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mark_recommendation_dismissed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mark_recommendation_dismissed({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mark_recommendation_dismissed name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mark_recommendation_dismissed ::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.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.mark_recommendation_dismissed({ 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.mark_recommendation_dismissed(::Google::Cloud::Recommender::V1::MarkRecommendationDismissedRequest.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, mark_recommendation_dismissed_client_stub.call_rpc_count - end - end - - def test_mark_recommendation_claimed - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_claimed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mark_recommendation_claimed, name - assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, request - assert_equal "hello world", request["name"] - assert_equal({}, request["state_metadata"].to_h) - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mark_recommendation_claimed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mark_recommendation_claimed name: name, state_metadata: state_metadata, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mark_recommendation_claimed ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mark_recommendation_claimed({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mark_recommendation_claimed(::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mark_recommendation_claimed_client_stub.call_rpc_count - end - end - - def test_mark_recommendation_succeeded - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_succeeded_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mark_recommendation_succeeded, name - assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, request - assert_equal "hello world", request["name"] - assert_equal({}, request["state_metadata"].to_h) - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mark_recommendation_succeeded_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mark_recommendation_succeeded name: name, state_metadata: state_metadata, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mark_recommendation_succeeded ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mark_recommendation_succeeded({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mark_recommendation_succeeded(::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mark_recommendation_succeeded_client_stub.call_rpc_count - end - end - - def test_mark_recommendation_failed - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::Recommendation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - state_metadata = {} - etag = "hello world" - - mark_recommendation_failed_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :mark_recommendation_failed, name - assert_kind_of ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, request - assert_equal "hello world", request["name"] - assert_equal({}, request["state_metadata"].to_h) - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, mark_recommendation_failed_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.mark_recommendation_failed name: name, state_metadata: state_metadata, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.mark_recommendation_failed ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.mark_recommendation_failed({ name: name, state_metadata: state_metadata, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.mark_recommendation_failed(::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new(name: name, state_metadata: state_metadata, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, mark_recommendation_failed_client_stub.call_rpc_count - end - end - - def test_get_recommender_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::RecommenderConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_recommender_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_recommender_config, name - assert_kind_of ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_recommender_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_recommender_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_recommender_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_recommender_config ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_recommender_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_recommender_config(::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_recommender_config_client_stub.call_rpc_count - end - end - - def test_update_recommender_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::RecommenderConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - recommender_config = {} - update_mask = {} - validate_only = true - - update_recommender_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_recommender_config, name - assert_kind_of ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Recommender::V1::RecommenderConfig), request["recommender_config"] - 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_recommender_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_recommender_config recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_recommender_config ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_recommender_config({ recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_recommender_config(::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new(recommender_config: recommender_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_recommender_config_client_stub.call_rpc_count - end - end - - def test_get_insight_type_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_insight_type_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_insight_type_config, name - assert_kind_of ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_insight_type_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_insight_type_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_insight_type_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_insight_type_config ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_insight_type_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_insight_type_config(::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_insight_type_config_client_stub.call_rpc_count - end - end - - def test_update_insight_type_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Recommender::V1::InsightTypeConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - insight_type_config = {} - update_mask = {} - validate_only = true - - update_insight_type_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_insight_type_config, name - assert_kind_of ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Recommender::V1::InsightTypeConfig), request["insight_type_config"] - 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_insight_type_config_client_stub do - # Create client - client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_insight_type_config insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_insight_type_config ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_insight_type_config({ insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_insight_type_config(::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new(insight_type_config: insight_type_config, update_mask: update_mask, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_insight_type_config_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::Recommender::V1::Recommender::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::Recommender::V1::Recommender::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::Recommender::V1::Recommender::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Recommender::V1::Recommender::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender-v1/test/helper.rb b/owl-bot-staging/google-cloud-recommender-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recommender-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-recommender/.gitignore b/owl-bot-staging/google-cloud-recommender/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-recommender/.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-recommender/.repo-metadata.json b/owl-bot-staging/google-cloud-recommender/.repo-metadata.json deleted file mode 100644 index 9069bad13eac..000000000000 --- a/owl-bot-staging/google-cloud-recommender/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "recommender.googleapis.com", - "api_shortname": "recommender", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-recommender/latest", - "distribution_name": "google-cloud-recommender", - "is_cloud": true, - "language": "ruby", - "name": "recommender", - "name_pretty": "Recommender API", - "product_documentation": "https://cloud.google.com/recommender", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services.", - "ruby-cloud-env-prefix": "RECOMMENDER", - "ruby-cloud-product-url": "https://cloud.google.com/recommender", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-recommender/.rubocop.yml b/owl-bot-staging/google-cloud-recommender/.rubocop.yml deleted file mode 100644 index 7215da5958f1..000000000000 --- a/owl-bot-staging/google-cloud-recommender/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-recommender.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-recommender.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-recommender/.toys.rb b/owl-bot-staging/google-cloud-recommender/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-recommender/.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-recommender/.yardopts b/owl-bot-staging/google-cloud-recommender/.yardopts deleted file mode 100644 index 06acaa595a14..000000000000 --- a/owl-bot-staging/google-cloud-recommender/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Recommender 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-recommender/AUTHENTICATION.md b/owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md deleted file mode 100644 index f4a097096b14..000000000000 --- a/owl-bot-staging/google-cloud-recommender/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-recommender 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-recommender 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/recommender" - -client = Google::Cloud::Recommender.recommender_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/recommender" - -Google::Cloud::Recommender.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Recommender.recommender_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-recommender -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/recommender" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Recommender.recommender_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-recommender/CHANGELOG.md b/owl-bot-staging/google-cloud-recommender/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-recommender/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-recommender/Gemfile b/owl-bot-staging/google-cloud-recommender/Gemfile deleted file mode 100644 index 1aa2e2245658..000000000000 --- a/owl-bot-staging/google-cloud-recommender/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-recommender-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-recommender.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-recommender/LICENSE.md b/owl-bot-staging/google-cloud-recommender/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-recommender/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-recommender/README.md b/owl-bot-staging/google-cloud-recommender/README.md deleted file mode 100644 index 38b53ad2f622..000000000000 --- a/owl-bot-staging/google-cloud-recommender/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Recommender API - -API Client library for the Recommender API - -Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-recommender-v*`. -The gem `google-cloud-recommender` 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-recommender/latest) -for this library, google-cloud-recommender, 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-recommender-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/recommender) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-recommender -``` - -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/recommender.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/recommender" - -client = Google::Cloud::Recommender.recommender_service -request = ::Google::Cloud::Recommender::V1::ListInsightsRequest.new # (request fields as keyword arguments...) -response = client.list_insights 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-recommender-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-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-recommender`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-recommender-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-recommender`. -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-recommender-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-recommender/Rakefile b/owl-bot-staging/google-cloud-recommender/Rakefile deleted file mode 100644 index c04db1ffb5eb..000000000000 --- a/owl-bot-staging/google-cloud-recommender/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-recommender acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["RECOMMENDER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["RECOMMENDER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["RECOMMENDER_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 RECOMMENDER_TEST_PROJECT=test123 RECOMMENDER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/recommender/v1/recommender/credentials" - ::Google::Cloud::Recommender::V1::Recommender::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["RECOMMENDER_PROJECT"] = project - ENV["RECOMMENDER_TEST_PROJECT"] = project - ENV["RECOMMENDER_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-recommender 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-recommender 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-recommender 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-recommender gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-recommender" - header "google-cloud-recommender rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-recommender yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-recommender 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-recommender 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-recommender 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-recommender/google-cloud-recommender.gemspec b/owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec deleted file mode 100644 index 898eb3e719f8..000000000000 --- a/owl-bot-staging/google-cloud-recommender/google-cloud-recommender.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/recommender/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-recommender" - gem.version = Google::Cloud::Recommender::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Recommender is a service on Google Cloud that provides usage recommendations for Cloud products and services." - gem.summary = "API Client library for the Recommender 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-recommender-v1", ">= 0.17", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb b/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.rb deleted file mode 100644 index ac3b14c26b03..000000000000 --- a/owl-bot-staging/google-cloud-recommender/lib/google-cloud-recommender.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/recommender" unless defined? Google::Cloud::Recommender::VERSION diff --git a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb deleted file mode 100644 index 2bd4d3d9d48e..000000000000 --- a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/recommender/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! :recommender 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 Recommender - ## - # Create a new client object for Recommender. - # - # By default, this returns an instance of - # [Google::Cloud::Recommender::V1::Recommender::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-recommender-v1/latest/Google-Cloud-Recommender-V1-Recommender-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 Recommender 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 Recommender service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Recommender.recommender_service_available?}. - # - # ## About Recommender - # - # Provides insights and recommendations for cloud customers for various - # categories like performance optimization, cost savings, reliability, feature - # discovery, etc. Insights and recommendations are generated automatically - # based on analysis of user resources, configuration and monitoring metrics. - # - # @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.recommender_service version: :v1, transport: :grpc, &block - require "google/cloud/recommender/#{version.to_s.downcase}" - - package_name = Google::Cloud::Recommender - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Recommender.const_get(package_name).const_get(:Recommender) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Recommender service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Recommender.recommender_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 Recommender service, - # or if the versioned client gem needs an update to support the Recommender 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.recommender_service_available? version: :v1, transport: :grpc - require "google/cloud/recommender/#{version.to_s.downcase}" - package_name = Google::Cloud::Recommender - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Recommender.const_get package_name - return false unless service_module.const_defined? :Recommender - service_module = service_module.const_get :Recommender - 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-recommender 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.recommender if block_given? - - ::Google::Cloud.configure.recommender - end - end - end -end - -helper_path = ::File.join __dir__, "recommender", "helpers.rb" -require "google/cloud/recommender/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb b/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/version.rb deleted file mode 100644 index 7e2bc1ccb49e..000000000000 --- a/owl-bot-staging/google-cloud-recommender/lib/google/cloud/recommender/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 Recommender - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/client_test.rb deleted file mode 100644 index c7303bf4879a..000000000000 --- a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/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/recommender" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Recommender::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_recommender_service_grpc - skip unless Google::Cloud::Recommender.recommender_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::Recommender.recommender_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Recommender::V1::Recommender::Client, client - end - end - - def test_recommender_service_rest - skip unless Google::Cloud::Recommender.recommender_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Recommender.recommender_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Recommender::V1::Recommender::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb b/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/version_test.rb deleted file mode 100644 index c28abec8aed6..000000000000 --- a/owl-bot-staging/google-cloud-recommender/test/google/cloud/recommender/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/recommender/version" - -class Google::Cloud::Recommender::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Recommender::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-recommender/test/helper.rb b/owl-bot-staging/google-cloud-recommender/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-recommender/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-cluster-v1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json deleted file mode 100644 index 4dc4ab2c485b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest", - "distribution_name": "google-cloud-redis-cluster-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/cluster", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml deleted file mode 100644 index b44047501f44..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-cluster-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-cluster-v1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1/.yardopts deleted file mode 100644 index 6b73bdb64053..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md deleted file mode 100644 index f468015d7991..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-cluster-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-cluster-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/cluster/v1" - -client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/cluster/v1" - -::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-redis-cluster-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/cluster/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1/README.md deleted file mode 100644 index d2c06dbded3f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-redis-cluster-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/cluster/v1" - -client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new -request = ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new # (request fields as keyword arguments...) -response = client.list_clusters request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/redis/cluster/v1" -require "logger" - -client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-redis-cluster`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-cluster-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-cluster`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-redis-cluster-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-cluster-v1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1/Rakefile deleted file mode 100644 index 05f433f76c68..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-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/redis/cluster/v1/cloud_redis_cluster/credentials" - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-redis-cluster-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-cluster-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-cluster-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-cluster-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-cluster-v1" - header "google-cloud-redis-cluster-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-cluster-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-cluster-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-cluster-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-cluster-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-cluster-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json deleted file mode 100644 index 17aa593b5298..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.redis.cluster.v1", - "libraryPackage": "::Google::Cloud::Redis::Cluster::V1", - "services": { - "CloudRedisCluster": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client", - "rpcs": { - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "GetClusterCertificateAuthority": { - "methods": [ - "get_cluster_certificate_authority" - ] - }, - "RescheduleClusterMaintenance": { - "methods": [ - "reschedule_cluster_maintenance" - ] - }, - "ListBackupCollections": { - "methods": [ - "list_backup_collections" - ] - }, - "GetBackupCollection": { - "methods": [ - "get_backup_collection" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "ExportBackup": { - "methods": [ - "export_backup" - ] - }, - "BackupCluster": { - "methods": [ - "backup_cluster" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec deleted file mode 100644 index 412b717e7cb7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/google-cloud-redis-cluster-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/cluster/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-cluster-v1" - gem.version = Google::Cloud::Redis::Cluster::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-cluster-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." - gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.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-cluster-v1/lib/google-cloud-redis-cluster-v1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-v1.rb deleted file mode 100644 index ad69d0f55f24..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google-cloud-redis-cluster-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/cluster/v1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1.rb deleted file mode 100644 index b90b149f1c11..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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/redis/cluster/v1/cloud_redis_cluster" -require "google/cloud/redis/cluster/v1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/redis/cluster/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb deleted file mode 100644 index 921b92c9c5a7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Redis - module Cluster - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/redis/cluster/v1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/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 -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb deleted file mode 100644 index 1723c4483690..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/redis/cluster/v1/version" - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/operations" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/client" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1/cloud_redis_cluster" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb deleted file mode 100644 index bed8f3e71ba5..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb +++ /dev/null @@ -1,1958 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" -require "google/cloud/location" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - ## - # Client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "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_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @cloud_redis_cluster_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.cluster&.name - header_params["cluster.name"] = request.cluster.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_backup_collections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_backup_collection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_backups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_backups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_backup, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.export_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.export_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :export_backup, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.backup_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :backup_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudRedisCluster API. - # - # This class represents the configuration for CloudRedisCluster, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CloudRedisCluster API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb deleted file mode 100644 index a1aec2d413d5..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - # Credentials for the CloudRedisCluster API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb deleted file mode 100644 index 747f251366ae..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb deleted file mode 100644 index b91229a8ebc8..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - # Path helper methods for the CloudRedisCluster API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup_collection:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" - end - - ## - # Create a fully-qualified BackupCollection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # - # @return [::String] - def backup_collection_path project:, location:, backup_collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" - end - - ## - # Create a fully-qualified CertificateAuthority resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def certificate_authority_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified ForwardingRule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` - # - # @param project [String] - # @param region [String] - # @param forwarding_rule [String] - # - # @return [::String] - def forwarding_rule_path project:, region:, forwarding_rule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified ServiceAttachment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` - # - # @param project [String] - # @param region [String] - # @param service_attachment [String] - # - # @return [::String] - def service_attachment_path project:, region:, service_attachment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb deleted file mode 100644 index 1ac33481a165..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/redis/cluster/v1/version" -require "google/cloud/redis/cluster/v1/bindings_override" - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client" - -module Google - module Cloud - module Redis - module Cluster - module V1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb deleted file mode 100644 index 57fcd4439829..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb +++ /dev/null @@ -1,1825 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - module Rest - ## - # REST client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "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_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_redis_cluster_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.update_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.create_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster_certificate_authority request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.reschedule_cluster_maintenance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_backup_collections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_backup_collection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_backups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_backup request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.export_backup request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.backup_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.backup_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudRedisCluster REST API. - # - # This class represents the configuration for CloudRedisCluster REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudRedisCluster API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb deleted file mode 100644 index 80457d34dddb..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb +++ /dev/null @@ -1,926 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb deleted file mode 100644 index 7a2343f54ef2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb +++ /dev/null @@ -1,942 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - module Rest - ## - # REST service stub for the CloudRedisCluster service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::Cluster.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority] - # A result object deserialized from the server's reply - def get_cluster_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cluster_certificate_authority", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::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 reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def reschedule_cluster_maintenance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "reschedule_cluster_maintenance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse] - # A result object deserialized from the server's reply - def list_backup_collections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_backup_collections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection] - # A result object deserialized from the server's reply - def get_backup_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_backup_collection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse] - # A result object deserialized from the server's reply - def list_backups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_backups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1::Backup] - # A result object deserialized from the server's reply - def get_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1::Backup.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def export_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def backup_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "backup_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reschedule_cluster_maintenance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:rescheduleClusterMaintenance", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_backup_collections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backupCollections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_backup_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_backups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/backups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_backup_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:backup", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb deleted file mode 100644 index 81a3ee3e4f89..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n7google/cloud/redis/cluster/v1/cloud_redis_cluster.proto\x12\x1dgoogle.cloud.redis.cluster.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#google/longrunning/operations.proto\x1a\x19google/protobuf/any.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\"\xbc\x01\n\x14\x43reateClusterRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x07\x63luster\x18\x03 \x01(\x0b\x32&.google.cloud.redis.cluster.v1.ClusterB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"w\n\x13ListClustersRequest\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\"~\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32&.google.cloud.redis.cluster.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12<\n\x07\x63luster\x18\x02 \x01(\x0b\x32&.google.cloud.redis.cluster.v1.ClusterB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"G\n\x11GetClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\"^\n\x14\x44\x65leteClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"h\n%GetClusterCertificateAuthorityRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)redis.googleapis.com/CertificateAuthority\"\x8e\x01\n\x1cListBackupCollectionsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%redis.googleapis.com/BackupCollection\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\"\x9a\x01\n\x1dListBackupCollectionsResponse\x12K\n\x12\x62\x61\x63kup_collections\x18\x01 \x03(\x0b\x32/.google.cloud.redis.cluster.v1.BackupCollection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Y\n\x1aGetBackupCollectionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%redis.googleapis.com/BackupCollection\"z\n\x12ListBackupsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bredis.googleapis.com/Backup\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\x13ListBackupsResponse\x12\x36\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32%.google.cloud.redis.cluster.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"E\n\x10GetBackupRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/Backup\"i\n\x13\x44\x65leteBackupRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"m\n\x13\x45xportBackupRequest\x12\x14\n\ngcs_bucket\x18\x03 \x01(\tH\x00\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bredis.googleapis.com/BackupB\r\n\x0b\x64\x65stination\"\xa2\x01\n\x14\x42\x61\x63kupClusterRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\tbackup_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0c\n\n_backup_id\"\xd0\x16\n\x07\x43luster\x12Q\n\ngcs_source\x18\" \x01(\x0b\x32\x36.google.cloud.redis.cluster.v1.Cluster.GcsBackupSourceB\x03\xe0\x41\x01H\x00\x12`\n\x15managed_backup_source\x18# \x01(\x0b\x32:.google.cloud.redis.cluster.v1.Cluster.ManagedBackupSourceB\x03\xe0\x41\x01H\x00\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x05state\x18\x04 \x01(\x0e\x32,.google.cloud.redis.cluster.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\rreplica_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12Q\n\x12\x61uthorization_mode\x18\x0b \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1.AuthorizationModeB\x03\xe0\x41\x01\x12Z\n\x17transit_encryption_mode\x18\x0c \x01(\x0e\x32\x34.google.cloud.redis.cluster.v1.TransitEncryptionModeB\x03\xe0\x41\x01\x12\x19\n\x07size_gb\x18\r \x01(\x05\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x12\x1d\n\x0bshard_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x42\n\x0bpsc_configs\x18\x0f \x03(\x0b\x32(.google.cloud.redis.cluster.v1.PscConfigB\x03\xe0\x41\x01\x12R\n\x13\x64iscovery_endpoints\x18\x10 \x03(\x0b\x32\x30.google.cloud.redis.cluster.v1.DiscoveryEndpointB\x03\xe0\x41\x03\x12J\n\x0fpsc_connections\x18\x11 \x03(\x0b\x32,.google.cloud.redis.cluster.v1.PscConnectionB\x03\xe0\x41\x03\x12I\n\nstate_info\x18\x12 \x01(\x0b\x32\x30.google.cloud.redis.cluster.v1.Cluster.StateInfoB\x03\xe0\x41\x03\x12?\n\tnode_type\x18\x13 \x01(\x0e\x32\'.google.cloud.redis.cluster.v1.NodeTypeB\x03\xe0\x41\x01\x12X\n\x12persistence_config\x18\x14 \x01(\x0b\x32\x37.google.cloud.redis.cluster.v1.ClusterPersistenceConfigB\x03\xe0\x41\x01\x12T\n\rredis_configs\x18\x15 \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1.Cluster.RedisConfigsEntryB\x03\xe0\x41\x01\x12!\n\x0fprecise_size_gb\x18\x16 \x01(\x01\x42\x03\xe0\x41\x03H\x04\x88\x01\x01\x12\\\n\x18zone_distribution_config\x18\x17 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1.ZoneDistributionConfigB\x03\xe0\x41\x01\x12k\n cross_cluster_replication_config\x18\x18 \x01(\x0b\x32<.google.cloud.redis.cluster.v1.CrossClusterReplicationConfigB\x03\xe0\x41\x01\x12-\n\x1b\x64\x65letion_protection_enabled\x18\x19 \x01(\x08\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12]\n\x12maintenance_policy\x18\x1a \x01(\x0b\x32\x37.google.cloud.redis.cluster.v1.ClusterMaintenancePolicyB\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x61\n\x14maintenance_schedule\x18\x1b \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12Y\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1.PscServiceAttachmentB\x03\xe0\x41\x03\x12N\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32..google.cloud.redis.cluster.v1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12Z\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x34.google.cloud.redis.cluster.v1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12K\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32-.google.cloud.redis.cluster.v1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xea\x01\n\tStateInfo\x12R\n\x0bupdate_info\x18\x01 \x01(\x0b\x32;.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x85\x04\n\x15\x41utomatedBackupConfig\x12t\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32K.google.cloud.redis.cluster.v1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12l\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32H.google.cloud.redis.cluster.v1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x82\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32).google.cloud.redis.cluster.v1.BackupFileB\x03\xe0\x41\x03\x12?\n\tnode_type\x18\t \x01(\x0e\x32\'.google.cloud.redis.cluster.v1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12J\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1.Backup.BackupTypeB\x03\xe0\x41\x03\x12?\n\x05state\x18\r \x01(\x0e\x32+.google.cloud.redis.cluster.v1.Backup.StateB\x03\xe0\x41\x03\x12K\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32-.google.cloud.redis.cluster.v1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x84\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"\xf4\x06\n\x1d\x43rossClusterReplicationConfig\x12^\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32H.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.ClusterRole\x12\x63\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster\x12\x66\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12`\n\nmembership\x18\x05 \x01(\x0b\x32G.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xe3\x01\n\nMembership\x12h\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12k\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32J.google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xe8\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12`\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32=.google.cloud.redis.cluster.v1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x7f\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x41\n\npsc_config\x18\x03 \x01(\x0b\x32(.google.cloud.redis.cluster.v1.PscConfigB\x03\xe0\x41\x03\"\xda\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12V\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.PscConnectionStatusB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"W\n\x0f\x43lusterEndpoint\x12\x44\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32/.google.cloud.redis.cluster.v1.ConnectionDetail\"\xb9\x01\n\x10\x43onnectionDetail\x12O\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x30.google.cloud.redis.cluster.v1.PscAutoConnectionH\x00\x12\x46\n\x0epsc_connection\x18\x02 \x01(\x0b\x32,.google.cloud.redis.cluster.v1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xde\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12V\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.PscConnectionStatusB\x03\xe0\x41\x03\x12K\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32-.google.cloud.redis.cluster.v1.ConnectionTypeB\x03\xe0\x41\x03\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x85\x04\n\x14\x43\x65rtificateAuthority\x12l\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xad\x01\n\x1bManagedCertificateAuthority\x12k\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32Y.google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\x87\x07\n\x18\x43lusterPersistenceConfig\x12Z\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12Z\n\nrdb_config\x18\x02 \x01(\x0b\x32\x41.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12Z\n\naof_config\x18\x03 \x01(\x0b\x32\x41.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xba\x02\n\tRDBConfig\x12r\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32P.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc4\x01\n\tAOFConfig\x12h\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xeb\x01\n\x16ZoneDistributionConfig\x12]\n\x04mode\x18\x01 \x01(\x0e\x32J.google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xd7\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12o\n\x0freschedule_type\x18\x02 \x01(\x0e\x32Q.google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\xfa\x04\n\x0e\x45ncryptionInfo\x12P\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12]\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32\x39.google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\x93\x18\n\x11\x43loudRedisCluster\x12\xb6\x01\n\x0cListClusters\x12\x32.google.cloud.redis.cluster.v1.ListClustersRequest\x1a\x33.google.cloud.redis.cluster.v1.ListClustersResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/clusters\x12\xa3\x01\n\nGetCluster\x12\x30.google.cloud.redis.cluster.v1.GetClusterRequest\x1a&.google.cloud.redis.cluster.v1.Cluster\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/clusters/*}\x12\xe1\x01\n\rUpdateCluster\x12\x33.google.cloud.redis.cluster.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xcf\x01\n\rDeleteCluster\x12\x33.google.cloud.redis.cluster.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/clusters/*}\x12\xdf\x01\n\rCreateCluster\x12\x33.google.cloud.redis.cluster.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xed\x01\n\x1eGetClusterCertificateAuthority\x12\x44.google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest\x1a\x33.google.cloud.redis.cluster.v1.CertificateAuthority\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\x12\x41/v1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\x9e\x02\n\x1cRescheduleClusterMaintenance\x12\x42.google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xda\x01\n\x15ListBackupCollections\x12;.google.cloud.redis.cluster.v1.ListBackupCollectionsRequest\x1a<.google.cloud.redis.cluster.v1.ListBackupCollectionsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/backupCollections\x12\xc7\x01\n\x13GetBackupCollection\x12\x39.google.cloud.redis.cluster.v1.GetBackupCollectionRequest\x1a/.google.cloud.redis.cluster.v1.BackupCollection\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/backupCollections/*}\x12\xc6\x01\n\x0bListBackups\x12\x31.google.cloud.redis.cluster.v1.ListBackupsRequest\x1a\x32.google.cloud.redis.cluster.v1.ListBackupsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xb3\x01\n\tGetBackup\x12/.google.cloud.redis.cluster.v1.GetBackupRequest\x1a%.google.cloud.redis.cluster.v1.Backup\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xe0\x01\n\x0c\x44\x65leteBackup\x12\x32.google.cloud.redis.cluster.v1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xd4\x01\n\x0c\x45xportBackup\x12\x32.google.cloud.redis.cluster.v1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02K\"F/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xcb\x01\n\rBackupCluster\x12\x33.google.cloud.redis.cluster.v1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xff\x05\n!com.google.cloud.redis.cluster.v1B\x16\x43loudRedisClusterProtoP\x01Z;cloud.google.com/go/redis/cluster/apiv1/clusterpb;clusterpb\xea\x02!Google::Cloud::Redis::Cluster::V1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -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.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.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 Cluster - module V1 - CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CreateClusterRequest").msgclass - ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListClustersRequest").msgclass - ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListClustersResponse").msgclass - UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.UpdateClusterRequest").msgclass - GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetClusterRequest").msgclass - DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DeleteClusterRequest").msgclass - GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetClusterCertificateAuthorityRequest").msgclass - ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupCollectionsRequest").msgclass - ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupCollectionsResponse").msgclass - GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetBackupCollectionRequest").msgclass - ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupsRequest").msgclass - ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ListBackupsResponse").msgclass - GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.GetBackupRequest").msgclass - DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DeleteBackupRequest").msgclass - ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ExportBackupRequest").msgclass - BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupClusterRequest").msgclass - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster").msgclass - Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.StateInfo").msgclass - Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo").msgclass - Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.GcsBackupSource").msgclass - Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.ManagedBackupSource").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Cluster.State").enummodule - AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig").msgclass - AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass - AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AutomatedBackupConfig.AutomatedBackupMode").enummodule - BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupCollection").msgclass - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup").msgclass - Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup.BackupType").enummodule - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.Backup.State").enummodule - BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.BackupFile").msgclass - PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscServiceAttachment").msgclass - CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig").msgclass - CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.RemoteCluster").msgclass - CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.Membership").msgclass - CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CrossClusterReplicationConfig.ClusterRole").enummodule - ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterMaintenancePolicy").msgclass - ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterWeeklyMaintenanceWindow").msgclass - ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterMaintenanceSchedule").msgclass - PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConfig").msgclass - DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.DiscoveryEndpoint").msgclass - PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConnection").msgclass - ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterEndpoint").msgclass - ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ConnectionDetail").msgclass - PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscAutoConnection").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.OperationMetadata").msgclass - CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass - ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig").msgclass - ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig").msgclass - ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule - ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig").msgclass - ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule - ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ClusterPersistenceConfig.PersistenceMode").enummodule - ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ZoneDistributionConfig").msgclass - ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ZoneDistributionConfig.ZoneDistributionMode").enummodule - RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest").msgclass - RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule - EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo").msgclass - EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo.Type").enummodule - EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyState").enummodule - PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.PscConnectionStatus").enummodule - AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.AuthorizationMode").enummodule - NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.NodeType").enummodule - TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.TransitEncryptionMode").enummodule - ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1.ConnectionType").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb deleted file mode 100644 index c12f58333748..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.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/cluster/v1/cloud_redis_cluster_pb' - -module Google - module Cloud - module Redis - module Cluster - module V1 - module CloudRedisCluster - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.redis.cluster.v1.CloudRedisCluster' - - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse - # Gets the details of a specific Redis cluster. - rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1::Cluster - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, ::Google::Longrunning::Operation - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, ::Google::Longrunning::Operation - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, ::Google::Longrunning::Operation - # Gets the details of certificate authority information for Redis cluster. - rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1::CertificateAuthority - # Reschedules upcoming maintenance event. - rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse - # Get a backup collection. - rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1::BackupCollection - # Lists all backups owned by a backup collection. - rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse - # Gets the details of a specific backup. - rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1::Backup - # Deletes a specific backup. - rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Google::Longrunning::Operation - # Exports a specific backup to a customer target Cloud Storage URI. - rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Google::Longrunning::Operation - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/rest.rb deleted file mode 100644 index 67b43a7fe970..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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/redis/cluster/v1/cloud_redis_cluster/rest" -require "google/cloud/redis/cluster/v1/bindings_override" -require "google/cloud/redis/cluster/v1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/redis/cluster/v1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/version.rb deleted file mode 100644 index d7f95f4db5ed..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/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 Redis - module Cluster - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/README.md deleted file mode 100644 index 49fbb528a7ef..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-redis-cluster-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb deleted file mode 100644 index 1e14c692c0ef..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb +++ /dev/null @@ -1,1301 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1 - # Request for [CreateCluster][CloudRedis.CreateCluster]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] - # Required. The cluster that is to be created. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::Cluster>] - # A list of Redis clusters in the project in the specified location, - # or across all locations. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # Redis entry is included in the response with the `name` field set to a - # value of the form - # `projects/{project_id}/locations/{location_id}/clusters/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListClusters". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [UpdateCluster][CloudRedis.UpdateCluster]. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetCluster][CloudRedis.GetCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteCluster][CloudRedis.DeleteCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - class GetClusterCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackupCollections] - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupCollectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackupCollections]. - # @!attribute [rw] backup_collections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::BackupCollection>] - # A list of backupCollections in the project. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # backupCollection entry is included in the response with the `name` field - # set to a value of the form - # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListBackupCollections". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListBackupCollectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackupCollection]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - class GetBackupCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackups]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackups]. - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::Backup>] - # A list of backups in the project. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Backups that could not be reached. - class ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. Idempotent request UUID. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ExportBackup]. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class ExportBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [BackupCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @!attribute [rw] backup_id - # @return [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - class BackupClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cluster instance. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::GcsBackupSource] - # Optional. Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # Read permission is required to import from the provided Cloud Storage - # objects. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] managed_backup_source - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::ManagedBackupSource] - # Optional. Backups generated and managed by memorystore service. - # - # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. Identifier. Unique name of the resource in this scope including - # project and location using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp associated with the cluster creation request. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::State] - # Output only. The current state of this cluster. - # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned, unique identifier for the cluster. - # @!attribute [rw] replica_count - # @return [::Integer] - # Optional. The number of replica nodes per shard. - # @!attribute [rw] authorization_mode - # @return [::Google::Cloud::Redis::Cluster::V1::AuthorizationMode] - # Optional. The authorization mode of the Redis cluster. - # If not provided, auth feature is disabled for the cluster. - # @!attribute [rw] transit_encryption_mode - # @return [::Google::Cloud::Redis::Cluster::V1::TransitEncryptionMode] - # Optional. The in-transit encryption for the Redis cluster. - # If not provided, encryption is disabled for the cluster. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Redis memory size in GB for the entire cluster rounded up to - # the next integer. - # @!attribute [rw] shard_count - # @return [::Integer] - # Optional. Number of shards for the Redis cluster. - # @!attribute [rw] psc_configs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscConfig>] - # Optional. Each PscConfig configures the consumer network where IPs will - # be designated to the cluster for client access through Private Service - # Connect Automation. Currently, only one PscConfig is supported. - # @!attribute [r] discovery_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::DiscoveryEndpoint>] - # Output only. Endpoints created on each given network, for Redis clients to - # connect to the cluster. Currently only one discovery endpoint is supported. - # @!attribute [r] psc_connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscConnection>] - # Output only. The list of PSC connections that are auto-created through - # service connectivity automation. - # @!attribute [r] state_info - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::StateInfo] - # Output only. Additional information about the current state of the cluster. - # @!attribute [rw] node_type - # @return [::Google::Cloud::Redis::Cluster::V1::NodeType] - # Optional. The type of a redis node in the cluster. NodeType determines the - # underlying machine-type of a redis node. - # @!attribute [rw] persistence_config - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig] - # Optional. Persistence config (RDB, AOF) for the cluster. - # @!attribute [rw] redis_configs - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Key/Value pairs of customer overrides for mutable Redis Configs - # @!attribute [r] precise_size_gb - # @return [::Float] - # Output only. Precise value of redis memory size in GB for the entire - # cluster. - # @!attribute [rw] zone_distribution_config - # @return [::Google::Cloud::Redis::Cluster::V1::ZoneDistributionConfig] - # Optional. This config will be used to determine how the customer wants us - # to distribute cluster resources within the region. - # @!attribute [rw] cross_cluster_replication_config - # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig] - # Optional. Cross cluster replication config. - # @!attribute [rw] deletion_protection_enabled - # @return [::Boolean] - # Optional. The delete operation will fail when the value is set to true. - # @!attribute [rw] maintenance_policy - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterMaintenancePolicy] - # Optional. ClusterMaintenancePolicy determines when to allow or deny - # updates. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterMaintenanceSchedule] - # Output only. ClusterMaintenanceSchedule Output only Published maintenance - # schedule. - # @!attribute [r] psc_service_attachments - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::PscServiceAttachment>] - # Output only. Service attachment details to configure Psc connections - # @!attribute [rw] cluster_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ClusterEndpoint>] - # Optional. A list of cluster enpoints. - # @!attribute [r] backup_collection - # @return [::String] - # Optional. Output only. The backup collection full resource name. Example: - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} - # @!attribute [rw] kms_key - # @return [::String] - # Optional. The KMS key used to encrypt the at-rest data of the cluster. - # @!attribute [rw] automated_backup_config - # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig] - # Optional. The automated backup config for the cluster. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo] - # Output only. Encryption information of the data at rest of the cluster. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents additional information about the state of the cluster. - # @!attribute [rw] update_info - # @return [::Google::Cloud::Redis::Cluster::V1::Cluster::StateInfo::UpdateInfo] - # Describes ongoing update on the cluster when cluster state is UPDATING. - class StateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents information about an updating cluster. - # @!attribute [rw] target_shard_count - # @return [::Integer] - # Target number of shards for redis cluster - # @!attribute [rw] target_replica_count - # @return [::Integer] - # Target number of replica nodes per shard. - class UpdateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Optional. URIs of the GCS objects to import. - # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 - class GcsBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backups that generated and managed by memorystore. - # @!attribute [rw] backup - # @return [::String] - # Optional. Example: - # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} - # A shorter version (without the prefix) of the backup name is also - # supported, like - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} - # In this case, it assumes the backup is under redis.googleapis.com. - class ManagedBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RedisConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states of a Redis cluster. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # Redis cluster is being created. - CREATING = 1 - - # Redis cluster has been created and is fully usable. - ACTIVE = 2 - - # Redis cluster configuration is being updated. - UPDATING = 3 - - # Redis cluster is being deleted. - DELETING = 4 - end - end - - # The automated backup config for a cluster. - # @!attribute [rw] fixed_frequency_schedule - # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig::FixedFrequencySchedule] - # Optional. Trigger automated backups at a fixed frequency. - # @!attribute [rw] automated_backup_mode - # @return [::Google::Cloud::Redis::Cluster::V1::AutomatedBackupConfig::AutomatedBackupMode] - # Optional. The automated backup mode. If the mode is disabled, the other - # fields will be ignored. - # @!attribute [rw] retention - # @return [::Google::Protobuf::Duration] - # Optional. How long to keep automated backups before the backups are - # deleted. The value should be between 1 day and 365 days. If not specified, - # the default value is 35 days. - class AutomatedBackupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This schedule allows the backup to be triggered at a fixed frequency - # (currently only daily is supported). - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Required. The start time of every automated backup in UTC. It must be set - # to the start of an hour. This field is required. - class FixedFrequencySchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The automated backup mode. - module AutomatedBackupMode - # Default value. Automated backup config is not specified. - AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 - - # Automated backup config disabled. - DISABLED = 1 - - # Automated backup config enabled. - ENABLED = 2 - end - end - - # BackupCollection of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup collection. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. The cluster uid of the backup collection. - # @!attribute [r] cluster - # @return [::String] - # Output only. The full resource path of the cluster the backup collection - # belongs to. Example: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @!attribute [r] kms_key - # @return [::String] - # Output only. The KMS key used to encrypt the backups under this backup - # collection. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup collection. - class BackupCollection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backup of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup. the last part of the name is - # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster - # UID] OR customer specified while backup cluster. Example: - # 20240515123000_1234 - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup was created. - # @!attribute [r] cluster - # @return [::String] - # Output only. Cluster resource path of this backup. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. Cluster uid of this backup. - # @!attribute [r] total_size_bytes - # @return [::Integer] - # Output only. Total size of the backup in bytes. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup will expire. - # @!attribute [r] engine_version - # @return [::String] - # Output only. redis-7.2, valkey-7.5 - # @!attribute [r] backup_files - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::BackupFile>] - # Output only. List of backup files of the backup. - # @!attribute [r] node_type - # @return [::Google::Cloud::Redis::Cluster::V1::NodeType] - # Output only. Node type of the cluster. - # @!attribute [r] replica_count - # @return [::Integer] - # Output only. Number of replicas for the cluster. - # @!attribute [r] shard_count - # @return [::Integer] - # Output only. Number of shards for the cluster. - # @!attribute [r] backup_type - # @return [::Google::Cloud::Redis::Cluster::V1::Backup::BackupType] - # Output only. Type of the backup. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1::Backup::State] - # Output only. State of the backup. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo] - # Output only. Encryption information of the backup. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup. - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the backup. - module BackupType - # The default value, not set. - BACKUP_TYPE_UNSPECIFIED = 0 - - # On-demand backup. - ON_DEMAND = 1 - - # Automated backup. - AUTOMATED = 2 - end - - # State of the backup. - module State - # The default value, not set. - STATE_UNSPECIFIED = 0 - - # The backup is being created. - CREATING = 1 - - # The backup is active to be used. - ACTIVE = 2 - - # The backup is being deleted. - DELETING = 3 - - # The backup is currently suspended due to reasons like project deletion, - # billing account closure, etc. - SUSPENDED = 4 - end - end - - # Backup is consisted of multiple backup files. - # @!attribute [r] file_name - # @return [::String] - # Output only. e.g: .rdb - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. Size of the backup file in bytes. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup file was created. - class BackupFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of a service attachment of the cluster, for creating PSC - # connections. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. Service attachment URI which your self-created PscConnection - # should use as target - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] - # Output only. Type of a PSC connection targeting this service attachment. - class PscServiceAttachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cross cluster replication config. - # @!attribute [rw] cluster_role - # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::ClusterRole] - # The role of the cluster in cross cluster replication. - # @!attribute [rw] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster] - # Details of the primary cluster that is used as the replication source for - # this secondary cluster. - # - # This field is only set for a secondary cluster. - # @!attribute [rw] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster>] - # List of secondary clusters that are replicating from this primary cluster. - # - # This field is only set for a primary cluster. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time cross cluster replication config was updated. - # @!attribute [r] membership - # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::Membership] - # Output only. An output only view of all the member clusters participating - # in the cross cluster replication. This view will be provided by every - # member cluster irrespective of its cluster role(primary or secondary). - # - # A primary cluster can provide information about all the secondary clusters - # replicating from it. However, a secondary cluster only knows about the - # primary cluster from which it is replicating. However, for scenarios, where - # the primary cluster is unavailable(e.g. regional outage), a GetCluster - # request can be sent to any other member cluster and this field will list - # all the member clusters participating in cross cluster replication. - class CrossClusterReplicationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details of the remote cluster associated with this cluster in a cross - # cluster replication setup. - # @!attribute [rw] cluster - # @return [::String] - # The full resource path of the remote cluster in - # the format: projects//locations//clusters/ - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the remote cluster. - class RemoteCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An output only view of all the member clusters participating in the cross - # cluster replication. - # @!attribute [r] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster] - # Output only. The primary cluster that acts as the source of replication - # for the secondary clusters. - # @!attribute [r] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CrossClusterReplicationConfig::RemoteCluster>] - # Output only. The list of secondary clusters replicating from the primary - # cluster. - class Membership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The role of the cluster in cross cluster replication. - module ClusterRole - # Cluster role is not set. - # The behavior is equivalent to NONE. - CLUSTER_ROLE_UNSPECIFIED = 0 - - # This cluster does not participate in cross cluster replication. It is an - # independent cluster and does not replicate to or from any other clusters. - NONE = 1 - - # A cluster that allows both reads and writes. Any data written to this - # cluster is also replicated to the attached secondary clusters. - PRIMARY = 2 - - # A cluster that allows only reads and replicates data from a primary - # cluster. - SECONDARY = 3 - end - end - - # Maintenance policy per cluster. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was created i.e. Maintenance Window - # or Deny Period was assigned. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was updated i.e. Maintenance Window - # or Deny Period was updated. - # @!attribute [rw] weekly_maintenance_window - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ClusterWeeklyMaintenanceWindow>] - # Optional. Maintenance window that is applied to resources covered by this - # policy. Minimum 1. For the current version, the maximum number of - # weekly_maintenance_window is expected to be one. - class ClusterMaintenancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time window specified for weekly operations. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Allows to define schedule that runs specified day of the week. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Start time of the window in UTC. - class ClusterWeeklyMaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upcoming maitenance schedule. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of any upcoming scheduled maintenance for this - # instance. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of any upcoming scheduled maintenance for this - # instance. - class ClusterMaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] network - # @return [::String] - # Required. The network where the IP address of the discovery endpoint will - # be reserved, in the form of - # projects/\\{network_project}/global/networks/\\{network_id}. - class PscConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpoints on each network, for Redis clients to connect to the cluster. - # @!attribute [r] address - # @return [::String] - # Output only. Address of the exposed Redis endpoint used by clients to - # connect to the service. The address could be either IP or hostname. - # @!attribute [r] port - # @return [::Integer] - # Output only. The port number of the exposed Redis endpoint. - # @!attribute [r] psc_config - # @return [::Google::Cloud::Redis::Cluster::V1::PscConfig] - # Output only. Customer configuration for where the endpoint is created and - # accessed from. - class DiscoveryEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection. - # @!attribute [rw] psc_connection_id - # @return [::String] - # Required. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [rw] address - # @return [::String] - # Required. The IP allocated on the consumer network for the PSC forwarding - # rule. - # @!attribute [rw] forwarding_rule - # @return [::String] - # Required. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Optional. Project ID of the consumer project where the forwarding rule is - # created in. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [rw] service_attachment - # @return [::String] - # Required. The service attachment which is the target of the PSC connection, - # in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # To get the latest status of a PSC connection, follow - # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] - # Output only. Type of the PSC connection. - class PscConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ClusterEndpoint consists of PSC connections that are created - # as a group in each VPC network for accessing the cluster. In each group, - # there shall be one connection for each service attachment in the cluster. - # @!attribute [rw] connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::ConnectionDetail>] - # A group of PSC connections. They are created in the same VPC network, one - # for each service attachment in the cluster. - class ClusterEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed information of each PSC connection. - # @!attribute [rw] psc_auto_connection - # @return [::Google::Cloud::Redis::Cluster::V1::PscAutoConnection] - # Detailed information of a PSC connection that is created through - # service connectivity automation. - # - # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] psc_connection - # @return [::Google::Cloud::Redis::Cluster::V1::PscConnection] - # Detailed information of a PSC connection that is created by the customer - # who owns the cluster. - # - # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ConnectionDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection that is created through - # Service Connectivity Automation. - # @!attribute [r] psc_connection_id - # @return [::String] - # Output only. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [r] address - # @return [::String] - # Output only. The IP allocated on the consumer network for the PSC - # forwarding rule. - # @!attribute [r] forwarding_rule - # @return [::String] - # Output only. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The consumer project_id where the forwarding rule is created - # from. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. The service attachment which is the target of the PSC - # connection, in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # Please use Private Service Connect APIs for the latest status. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1::ConnectionType] - # Output only. Type of the PSC connection. - class PscAutoConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pre-defined metadata fields. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Redis cluster certificate authority - # @!attribute [rw] managed_server_ca - # @return [::Google::Cloud::Redis::Cluster::V1::CertificateAuthority::ManagedCertificateAuthority] - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique name of the resource in this scope including project, - # location and cluster using the form: - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - class CertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] ca_certs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] - # The PEM encoded CA certificate chains for redis managed - # server authentication - class ManagedCertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] certificates - # @return [::Array<::String>] - # The certificates that form the CA chain, from leaf to root order. - class CertChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration of the persistence functionality. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::PersistenceMode] - # Optional. The mode of persistence. - # @!attribute [rw] rdb_config - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::RDBConfig] - # Optional. RDB configuration. This field will be ignored if mode is not RDB. - # @!attribute [rw] aof_config - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::AOFConfig] - # Optional. AOF configuration. This field will be ignored if mode is not AOF. - class ClusterPersistenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of the RDB based persistence. - # @!attribute [rw] rdb_snapshot_period - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] - # Optional. Period between RDB snapshots. - # @!attribute [rw] rdb_snapshot_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time that the first snapshot was/will be attempted, and to - # which future snapshots will be aligned. If not provided, the current time - # will be used. - class RDBConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available snapshot periods. - module SnapshotPeriod - # Not set. - SNAPSHOT_PERIOD_UNSPECIFIED = 0 - - # One hour. - ONE_HOUR = 1 - - # Six hours. - SIX_HOURS = 2 - - # Twelve hours. - TWELVE_HOURS = 3 - - # Twenty four hours. - TWENTY_FOUR_HOURS = 4 - end - end - - # Configuration of the AOF based persistence. - # @!attribute [rw] append_fsync - # @return [::Google::Cloud::Redis::Cluster::V1::ClusterPersistenceConfig::AOFConfig::AppendFsync] - # Optional. fsync configuration. - class AOFConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available fsync modes. - module AppendFsync - # Not set. Default: EVERYSEC - APPEND_FSYNC_UNSPECIFIED = 0 - - # Never fsync. Normally Linux will flush data every 30 seconds with this - # configuration, but it's up to the kernel's exact tuning. - NO = 1 - - # fsync every second. Fast enough, and you may lose 1 second of data if - # there is a disaster - EVERYSEC = 2 - - # fsync every time new write commands are appended to the AOF. It has the - # best data loss protection at the cost of performance - ALWAYS = 3 - end - end - - # Available persistence modes. - module PersistenceMode - # Not set. - PERSISTENCE_MODE_UNSPECIFIED = 0 - - # Persistence is disabled, and any snapshot data is deleted. - DISABLED = 1 - - # RDB based persistence is enabled. - RDB = 2 - - # AOF based persistence is enabled. - AOF = 3 - end - end - - # Zone distribution config for allocation of cluster resources. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1::ZoneDistributionConfig::ZoneDistributionMode] - # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - # specified. - # @!attribute [rw] zone - # @return [::String] - # Optional. When SINGLE ZONE distribution is selected, zone field would be - # used to allocate all resources in that zone. This is not applicable to - # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - class ZoneDistributionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines various modes of zone distribution. - module ZoneDistributionMode - # Not Set. Default: MULTI_ZONE - ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 - - # Distribute all resources across 3 zones picked at random, within the - # region. - MULTI_ZONE = 1 - - # Distribute all resources in a single zone. The zone field must be - # specified, when this mode is selected. - SINGLE_ZONE = 2 - end - end - - # Request for rescheduling a cluster maintenance. - # @!attribute [rw] name - # @return [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] reschedule_type - # @return [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - class RescheduleClusterMaintenanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reschedule options. - module RescheduleType - # Not set. - RESCHEDULE_TYPE_UNSPECIFIED = 0 - - # If the user wants to schedule the maintenance to happen now. - IMMEDIATE = 1 - - # If the user wants to reschedule the maintenance to a specific time. - SPECIFIC_TIME = 3 - end - end - - # EncryptionInfo describes the encryption information of a cluster or a backup. - # @!attribute [r] encryption_type - # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo::Type] - # Output only. Type of encryption. - # @!attribute [r] kms_key_versions - # @return [::Array<::String>] - # Output only. KMS key versions that are being used to protect the data - # at-rest. - # @!attribute [r] kms_key_primary_state - # @return [::Google::Cloud::Redis::Cluster::V1::EncryptionInfo::KmsKeyState] - # Output only. The state of the primary version of the KMS key perceived by - # the system. This field is not populated in backups. - # @!attribute [r] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time when the encryption info was updated. - class EncryptionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible encryption types. - module Type - # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - TYPE_UNSPECIFIED = 0 - - # The data is encrypted at rest with a key that is fully managed by Google. - # No key version will be populated. This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1 - - # The data is encrypted at rest with a key that is managed by the customer. - # KMS key versions will be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2 - end - - # The state of the KMS key perceived by the system. Refer to the public - # documentation for the impact of each state. - module KmsKeyState - # The default value. This value is unused. - KMS_KEY_STATE_UNSPECIFIED = 0 - - # The KMS key is enabled and correctly configured. - ENABLED = 1 - - # Permission denied on the KMS key. - PERMISSION_DENIED = 2 - - # The KMS key is disabled. - DISABLED = 3 - - # The KMS key is destroyed. - DESTROYED = 4 - - # The KMS key is scheduled to be destroyed. - DESTROY_SCHEDULED = 5 - - # The EKM key is unreachable. - EKM_KEY_UNREACHABLE_DETECTED = 6 - - # Billing is disabled for the project. - BILLING_DISABLED = 7 - - # All other unknown failures. - UNKNOWN_FAILURE = 8 - end - end - - # Status of the PSC connection. - module PscConnectionStatus - # PSC connection status is not specified. - PSC_CONNECTION_STATUS_UNSPECIFIED = 0 - - # The connection is active - PSC_CONNECTION_STATUS_ACTIVE = 1 - - # Connection not found - PSC_CONNECTION_STATUS_NOT_FOUND = 2 - end - - # Available authorization mode of a Redis cluster. - module AuthorizationMode - # Not set. - AUTH_MODE_UNSPECIFIED = 0 - - # IAM basic authorization mode - AUTH_MODE_IAM_AUTH = 1 - - # Authorization disabled mode - AUTH_MODE_DISABLED = 2 - end - - # NodeType of a redis cluster node, - module NodeType - # Node type unspecified - NODE_TYPE_UNSPECIFIED = 0 - - # Redis shared core nano node_type. - REDIS_SHARED_CORE_NANO = 1 - - # Redis highmem medium node_type. - REDIS_HIGHMEM_MEDIUM = 2 - - # Redis highmem xlarge node_type. - REDIS_HIGHMEM_XLARGE = 3 - - # Redis standard small node_type. - REDIS_STANDARD_SMALL = 4 - end - - # Available mode of in-transit encryption. - module TransitEncryptionMode - # In-transit encryption not set. - TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 - - # In-transit encryption disabled. - TRANSIT_ENCRYPTION_MODE_DISABLED = 1 - - # Use server managed encryption for in-transit encryption. - TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 - end - - # Type of a PSC connection, for cluster access purpose. - module ConnectionType - # Cluster endpoint Type is not set - CONNECTION_TYPE_UNSPECIFIED = 0 - - # Cluster endpoint that will be used as for cluster topology discovery. - CONNECTION_TYPE_DISCOVERY = 1 - - # Cluster endpoint that will be used as primary endpoint to access primary. - CONNECTION_TYPE_PRIMARY = 2 - - # Cluster endpoint that will be used as reader endpoint to access replicas. - CONNECTION_TYPE_READER = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 973211b9ffe7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/Gemfile deleted file mode 100644 index 58f77436712d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1", path: "../" -else - gem "google-cloud-redis-cluster-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-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb deleted file mode 100644 index 0c6ce0e1de7f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/backup_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_BackupCluster_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the backup_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster. -# -def backup_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new - - # Call the backup_cluster method. - result = client.backup_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb deleted file mode 100644 index 37f74452d46f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/create_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_CreateCluster_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the create_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb deleted file mode 100644 index 763b06085393..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_DeleteBackup_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the delete_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb deleted file mode 100644 index 80a345a291ab..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/delete_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the delete_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb deleted file mode 100644 index 3253a0b70a52..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/export_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_ExportBackup_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the export_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup. -# -def export_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new - - # Call the export_backup method. - result = client.export_backup request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb deleted file mode 100644 index 1a02a8ff4991..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_GetBackup_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the get_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup. - p result -end -# [END redis_v1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb deleted file mode 100644 index 62449b7b71ac..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_backup_collection.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the get_backup_collection call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection. -# -def get_backup_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new - - # Call the get_backup_collection method. - result = client.get_backup_collection request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection. - p result -end -# [END redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb deleted file mode 100644 index 4b0acdfbd4c2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_GetCluster_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the get_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1::Cluster. - p result -end -# [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb deleted file mode 100644 index 391b0074cc95..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority. -# -def get_cluster_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new - - # Call the get_cluster_certificate_authority method. - result = client.get_cluster_certificate_authority request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1::CertificateAuthority. - p result -end -# [END redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb deleted file mode 100644 index 7ed3e74621d7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backup_collections.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the list_backup_collections call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections. -# -def list_backup_collections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new - - # Call the list_backup_collections method. - result = client.list_backup_collections request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection. - p item - end -end -# [END redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb deleted file mode 100644 index a7bd15fac329..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_backups.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_ListBackups_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the list_backups call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new - - # Call the list_backups method. - result = client.list_backups request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup. - p item - end -end -# [END redis_v1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb deleted file mode 100644 index 2d583522073c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/list_clusters.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_ListClusters_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the list_clusters call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Cluster. - p item - end -end -# [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb deleted file mode 100644 index 7723a7a80948..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance. -# -def reschedule_cluster_maintenance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new - - # Call the reschedule_cluster_maintenance method. - result = client.reschedule_cluster_maintenance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb deleted file mode 100644 index 8a3ba4936109..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/cloud_redis_cluster/update_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] -require "google/cloud/redis/cluster/v1" - -## -# Snippet for the update_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json b/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json deleted file mode 100644 index 01b74ba25300..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/snippets/snippet_metadata_google.cloud.redis.cluster.v1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-redis-cluster-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.redis.cluster.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "redis_v1_generated_CloudRedisCluster_ListClusters_sync", - "title": "Snippet for the list_clusters call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters.", - "file": "cloud_redis_cluster/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::ListClustersResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListClusters", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_GetCluster_sync", - "title": "Snippet for the get_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster.", - "file": "cloud_redis_cluster/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::Cluster", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster.", - "file": "cloud_redis_cluster/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.UpdateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster.", - "file": "cloud_redis_cluster/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.DeleteCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster.", - "file": "cloud_redis_cluster/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.CreateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", - "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority.", - "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster_certificate_authority", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_cluster_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::CertificateAuthority", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetClusterCertificateAuthority", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetClusterCertificateAuthority", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", - "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", - "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", - "language": "RUBY", - "client_method": { - "short_name": "reschedule_cluster_maintenance", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#reschedule_cluster_maintenance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "RescheduleClusterMaintenance", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.RescheduleClusterMaintenance", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_ListBackupCollections_sync", - "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections.", - "file": "cloud_redis_cluster/list_backup_collections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_collections", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backup_collections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackupCollections", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListBackupCollections", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_GetBackupCollection_sync", - "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection.", - "file": "cloud_redis_cluster/get_backup_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup_collection", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::BackupCollection", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackupCollection", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetBackupCollection", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_ListBackups_sync", - "title": "Snippet for the list_backups call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups.", - "file": "cloud_redis_cluster/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ListBackups", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_GetBackup_sync", - "title": "Snippet for the get_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup.", - "file": "cloud_redis_cluster/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1::Backup", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.GetBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup.", - "file": "cloud_redis_cluster/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.DeleteBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_ExportBackup_sync", - "title": "Snippet for the export_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup.", - "file": "cloud_redis_cluster/export_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#export_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ExportBackup", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.ExportBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1_generated_CloudRedisCluster_BackupCluster_sync", - "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster.", - "file": "cloud_redis_cluster/backup_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "backup_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client#backup_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "BackupCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster.BackupCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb deleted file mode 100644 index 5d97788e0794..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb deleted file mode 100644 index 1dfc3c812f64..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_backup_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" - assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path - end - end - - def test_backup_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" - assert_equal "projects/value0/locations/value1/backupCollections/value2", path - end - end - - def test_certificate_authority_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_crypto_key_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_forwarding_rule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" - assert_equal "projects/value0/regions/value1/forwardingRules/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_service_attachment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" - assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb deleted file mode 100644 index 7814e81f54bf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb +++ /dev/null @@ -1,873 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster/rest" - - -class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_get_cluster_certificate_authority - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::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_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_certificate_authority_client_stub.call_count - end - end - end - - def test_reschedule_cluster_maintenance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count - end - end - end - - def test_list_backup_collections - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backup_collections_client_stub.call_count - end - end - end - - def test_get_backup_collection - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup_collection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup_collection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup_collection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_collection_client_stub.call_count - end - end - end - - def test_list_backups - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backups parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1::Backup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_count - end - end - end - - def test_delete_backup - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_count - end - end - end - - def test_export_backup - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_backup ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_backup(::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_backup_client_stub.call_count - end - end - end - - def test_backup_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb deleted file mode 100644 index 74b7da02c81c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb +++ /dev/null @@ -1,1018 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListClustersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::Cluster.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Redis::Cluster::V1::GetClusterRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_rpc_count - end - end - - def test_get_cluster_certificate_authority - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::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_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster_certificate_authority, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster_certificate_authority({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1::GetClusterCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cluster_certificate_authority_client_stub.call_rpc_count - end - end - - def test_reschedule_cluster_maintenance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reschedule_cluster_maintenance, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, reschedule_cluster_maintenance_client_stub.call_rpc_count - end - end - - def test_list_backup_collections - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_collections, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backup_collections_client_stub.call_rpc_count - end - end - - def test_get_backup_collection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::BackupCollection.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup_collection, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup_collection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup_collection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup_collection({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_backup_collection_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backups, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1::Backup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_rpc_count - end - end - - def test_delete_backup - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_rpc_count - end - end - - def test_export_backup - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, request - assert_equal "hello world", request["gcs_bucket"] - assert_equal :gcs_bucket, request.destination - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_backup ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_backup(::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, export_backup_client_stub.call_rpc_count - end - end - - def test_backup_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :backup_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] - assert_equal "hello world", request["backup_id"] - assert request.has_backup_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/.gitignore b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json deleted file mode 100644 index 2ab1d03bbe46..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest", - "distribution_name": "google-cloud-redis-cluster-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis V1BETA1 API", - "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml deleted file mode 100644 index fc0606d1c085..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-cluster-v1beta1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-redis-cluster-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts deleted file mode 100644 index 599cfbea4d19..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud Memorystore for Redis V1BETA1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 9972a8b1c9f5..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-cluster-v1beta1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-redis-cluster-v1beta1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-redis-cluster-v1beta1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md deleted file mode 100644 index 51dd0050463a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Google Cloud Memorystore for Redis V1BETA1 API - -Creates and manages Redis instances on the Google Cloud Platform. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google Cloud Memorystore for Redis V1BETA1 API. Most users should consider using -the main client gem, -[google-cloud-redis-cluster](https://rubygems.org/gems/google-cloud-redis-cluster). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-redis-cluster-v1beta1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/redis.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/redis/cluster/v1beta1" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new -request = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new # (request fields as keyword arguments...) -response = client.list_clusters request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/redis/cluster/v1beta1" -require "logger" - -client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-redis-cluster`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-cluster-v1beta1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-redis-cluster`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-redis-cluster-v1beta1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile deleted file mode 100644 index ad063dcffe89..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-redis-cluster-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-redis-cluster-v1beta1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-cluster-v1beta1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-cluster-v1beta1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-redis-cluster-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-cluster-v1beta1" - header "google-cloud-redis-cluster-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-cluster-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-cluster-v1beta1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-redis-cluster-v1beta1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-redis-cluster-v1beta1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json deleted file mode 100644 index 1ecbc8224ac2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.redis.cluster.v1beta1", - "libraryPackage": "::Google::Cloud::Redis::Cluster::V1beta1", - "services": { - "CloudRedisCluster": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client", - "rpcs": { - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "GetClusterCertificateAuthority": { - "methods": [ - "get_cluster_certificate_authority" - ] - }, - "RescheduleClusterMaintenance": { - "methods": [ - "reschedule_cluster_maintenance" - ] - }, - "ListBackupCollections": { - "methods": [ - "list_backup_collections" - ] - }, - "GetBackupCollection": { - "methods": [ - "get_backup_collection" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "ExportBackup": { - "methods": [ - "export_backup" - ] - }, - "BackupCluster": { - "methods": [ - "backup_cluster" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec deleted file mode 100644 index 83483f0e982f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/google-cloud-redis-cluster-v1beta1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/cluster/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-cluster-v1beta1" - gem.version = Google::Cloud::Redis::Cluster::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates and manages Redis instances on the Google Cloud Platform. Note that google-cloud-redis-cluster-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-redis-cluster instead. See the readme for more details." - gem.summary = "Creates and manages Redis instances on the Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.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-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb deleted file mode 100644 index d6ebeaed939f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google-cloud-redis-cluster-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/redis/cluster/v1beta1" diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb deleted file mode 100644 index 9a8dca3ac28b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" -require "google/cloud/redis/cluster/v1beta1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1beta1" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1beta1" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/redis/cluster/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb deleted file mode 100644 index e71d4e449670..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module Redis - module Cluster - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/redis/cluster/v1beta1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb deleted file mode 100644 index 23fc244f3f90..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/redis/cluster/v1beta1/version" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_redis_cluster", "helpers.rb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb deleted file mode 100644 index 2c3aeac42e98..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb +++ /dev/null @@ -1,1958 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/location" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - ## - # Client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @cloud_redis_cluster_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.cluster&.name - header_params["cluster.name"] = request.cluster.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_backup_collections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_backup_collection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_backups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_backups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :delete_backup, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.export_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.export_backup.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :export_backup, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.backup_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.call_rpc :backup_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudRedisCluster API. - # - # This class represents the configuration for CloudRedisCluster, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CloudRedisCluster API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb deleted file mode 100644 index 95358ab0cf8d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Credentials for the CloudRedisCluster API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb deleted file mode 100644 index cef09e76cbb7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb deleted file mode 100644 index 4e928f81d245..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Path helper methods for the CloudRedisCluster API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup_collection:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" - end - - ## - # Create a fully-qualified BackupCollection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` - # - # @param project [String] - # @param location [String] - # @param backup_collection [String] - # - # @return [::String] - def backup_collection_path project:, location:, backup_collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" - end - - ## - # Create a fully-qualified CertificateAuthority resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def certificate_authority_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/certificateAuthority" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified ForwardingRule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}` - # - # @param project [String] - # @param region [String] - # @param forwarding_rule [String] - # - # @return [::String] - def forwarding_rule_path project:, region:, forwarding_rule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/forwardingRules/#{forwarding_rule}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified ServiceAttachment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` - # - # @param project [String] - # @param region [String] - # @param service_attachment [String] - # - # @return [::String] - def service_attachment_path project:, region:, service_attachment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb deleted file mode 100644 index 9dcf91ae8976..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/redis/cluster/v1beta1/version" -require "google/cloud/redis/cluster/v1beta1/bindings_override" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/credentials" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/paths" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - ## - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module CloudRedisCluster - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb deleted file mode 100644 index 7506c3777984..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/client.rb +++ /dev/null @@ -1,1825 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - ## - # REST client for the CloudRedisCluster service. - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_redis_cluster_stub - - ## - # Configure the CloudRedisCluster Client class. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudRedisCluster clients - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_clusters.timeout = 600.0 - - default_config.rpcs.get_cluster.timeout = 600.0 - - default_config.rpcs.update_cluster.timeout = 600.0 - - default_config.rpcs.delete_cluster.timeout = 600.0 - - default_config.rpcs.create_cluster.timeout = 600.0 - - default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0 - - default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 - - default_config.rpcs.list_backup_collections.timeout = 600.0 - - default_config.rpcs.get_backup_collection.timeout = 600.0 - - default_config.rpcs.list_backups.timeout = 600.0 - - default_config.rpcs.get_backup.timeout = 600.0 - - default_config.rpcs.delete_backup.timeout = 600.0 - - default_config.rpcs.export_backup.timeout = 600.0 - - default_config.rpcs.backup_cluster.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cloud_redis_cluster_stub.universe_domain - end - - ## - # Create a new CloudRedisCluster REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudRedisCluster client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_redis_cluster_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_redis_cluster_stub.endpoint - config.universe_domain = @cloud_redis_cluster_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_redis_cluster_stub.logger - end - - # Service calls - - ## - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific Redis cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.update_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param cluster_id [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @param cluster [::Google::Cloud::Redis::Cluster::V1beta1::Cluster, ::Hash] - # Required. The cluster that is to be created. - # @param request_id [::String] - # Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.create_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of certificate authority information for Redis cluster. - # - # @overload get_cluster_certificate_authority(request, options = nil) - # Pass arguments to `get_cluster_certificate_authority` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster_certificate_authority(name: nil) - # Pass arguments to `get_cluster_certificate_authority` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - # - # # Call the get_cluster_certificate_authority method. - # result = client.get_cluster_certificate_authority request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - # p result - # - def get_cluster_certificate_authority request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster_certificate_authority.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster_certificate_authority.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster_certificate_authority.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_cluster_certificate_authority request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reschedules upcoming maintenance event. - # - # @overload reschedule_cluster_maintenance(request, options = nil) - # Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) - # Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param reschedule_type [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - # - # # Call the reschedule_cluster_maintenance method. - # result = client.reschedule_cluster_maintenance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def reschedule_cluster_maintenance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.reschedule_cluster_maintenance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - # - # @overload list_backup_collections(request, options = nil) - # Pass arguments to `list_backup_collections` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backup_collections` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - # - # # Call the list_backup_collections method. - # result = client.list_backup_collections request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p item - # end - # - def list_backup_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_backup_collections.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backup_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a backup collection. - # - # @overload get_backup_collection(request, options = nil) - # Pass arguments to `get_backup_collection` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_backup_collection(name: nil) - # Pass arguments to `get_backup_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - # - # # Call the get_backup_collection method. - # result = client.get_backup_collection request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - # p result - # - def get_backup_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_backup_collection.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all backups owned by a backup collection. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_backups` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @param page_size [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @param page_token [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - # - # # Call the list_backups method. - # result = client.list_backups request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p item - # end - # - def list_backups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_backups.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_backups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_backups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.list_backups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a specific backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_backup(name: nil) - # Pass arguments to `get_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - # p result - # - def get_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.get_backup request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a specific backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil) - # Pass arguments to `delete_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @param request_id [::String] - # Optional. Idempotent request UUID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.delete_backup request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports a specific backup to a customer target Cloud Storage URI. - # - # @overload export_backup(request, options = nil) - # Pass arguments to `export_backup` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_backup(gcs_bucket: nil, name: nil) - # Pass arguments to `export_backup` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_bucket [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @param name [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - # - # # Call the export_backup method. - # result = client.export_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_backup.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_backup.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_backup.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.export_backup request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - # - # @overload backup_cluster(request, options = nil) - # Pass arguments to `backup_cluster` via a request object, either of type - # {::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload backup_cluster(name: nil, ttl: nil, backup_id: nil) - # Pass arguments to `backup_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @param ttl [::Google::Protobuf::Duration, ::Hash] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @param backup_id [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/redis/cluster/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - # - # # Call the backup_cluster method. - # result = client.backup_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def backup_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.backup_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.backup_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_redis_cluster_stub.backup_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudRedisCluster REST API. - # - # This class represents the configuration for CloudRedisCluster REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudRedisCluster API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `get_cluster_certificate_authority` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster_certificate_authority - ## - # RPC-specific configuration for `reschedule_cluster_maintenance` - # @return [::Gapic::Config::Method] - # - attr_reader :reschedule_cluster_maintenance - ## - # RPC-specific configuration for `list_backup_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backup_collections - ## - # RPC-specific configuration for `get_backup_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup_collection - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `delete_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_backup - ## - # RPC-specific configuration for `export_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :export_backup - ## - # RPC-specific configuration for `backup_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :backup_cluster - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority - @get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config - reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance - @reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config - list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections - @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config - get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection - @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup - @delete_backup = ::Gapic::Config::Method.new delete_backup_config - export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup - @export_backup = ::Gapic::Config::Method.new export_backup_config - backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster - @backup_cluster = ::Gapic::Config::Method.new backup_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb deleted file mode 100644 index fb3b4d97dfa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/operations.rb +++ /dev/null @@ -1,926 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "redis.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CloudRedisCluster Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudRedisCluster Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "redis.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb deleted file mode 100644 index 0b4291c4ede3..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest/service_stub.rb +++ /dev/null @@ -1,942 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - module Rest - ## - # REST service stub for the CloudRedisCluster service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority] - # A result object deserialized from the server's reply - def get_cluster_certificate_authority request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_certificate_authority_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cluster_certificate_authority", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def reschedule_cluster_maintenance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_cluster_maintenance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "reschedule_cluster_maintenance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse] - # A result object deserialized from the server's reply - def list_backup_collections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_backup_collections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection] - # A result object deserialized from the server's reply - def get_backup_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_backup_collection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse] - # A result object deserialized from the server's reply - def list_backups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_backups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup] - # A result object deserialized from the server's reply - def get_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def export_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def backup_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_backup_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "backup_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta1/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster_certificate_authority REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_certificate_authority_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/certificateAuthority/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reschedule_cluster_maintenance REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reschedule_cluster_maintenance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:rescheduleClusterMaintenance", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backup_collections REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_backup_collections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/backupCollections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup_collection REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_backup_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_backups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{parent}/backups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_backup REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_backup_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the backup_cluster REST call - # - # @param request_pb [::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_backup_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{name}:backup", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb deleted file mode 100644 index 510cbcdbc9b7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/any_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n.google.cloud.redis.cluster.v1beta1.ClusterMaintenanceScheduleB\x03\xe0\x41\x03H\x07\x88\x01\x01\x12^\n\x17psc_service_attachments\x18\x1e \x03(\x0b\x32\x38.google.cloud.redis.cluster.v1beta1.PscServiceAttachmentB\x03\xe0\x41\x03\x12S\n\x11\x63luster_endpoints\x18$ \x03(\x0b\x32\x33.google.cloud.redis.cluster.v1beta1.ClusterEndpointB\x03\xe0\x41\x01\x12P\n\x11\x62\x61\x63kup_collection\x18\' \x01(\tB0\xe0\x41\x01\xe0\x41\x03\xfa\x41\'\n%redis.googleapis.com/BackupCollectionH\x08\x88\x01\x01\x12?\n\x07kms_key\x18( \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\t\x88\x01\x01\x12_\n\x17\x61utomated_backup_config\x18* \x01(\x0b\x32\x39.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12P\n\x0f\x65ncryption_info\x18+ \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x1a\xef\x01\n\tStateInfo\x12W\n\x0bupdate_info\x18\x01 \x01(\x0b\x32@.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoH\x00\x1a\x80\x01\n\nUpdateInfo\x12\x1f\n\x12target_shard_count\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12!\n\x14target_replica_count\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:p\xea\x41m\n\x1credis.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterB\x10\n\x0eimport_sourcesB\x10\n\x0e_replica_countB\n\n\x08_size_gbB\x0e\n\x0c_shard_countB\x12\n\x10_precise_size_gbB\x1e\n\x1c_deletion_protection_enabledB\x15\n\x13_maintenance_policyB\x17\n\x15_maintenance_scheduleB\x14\n\x12_backup_collectionB\n\n\x08_kms_key\"\x8f\x04\n\x15\x41utomatedBackupConfig\x12y\n\x18\x66ixed_frequency_schedule\x18\x02 \x01(\x0b\x32P.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencyScheduleB\x03\xe0\x41\x01H\x00\x12q\n\x15\x61utomated_backup_mode\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupModeB\x03\xe0\x41\x01\x12\x36\n\tretention\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1a]\n\x16\x46ixedFrequencySchedule\x12\x34\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDayB\x03\xe0\x41\x02H\x00\x88\x01\x01\x42\r\n\x0b_start_time\"W\n\x13\x41utomatedBackupMode\x12%\n!AUTOMATED_BACKUP_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x42\n\n\x08scheduleB\x0c\n\n_retention\"\xf6\x02\n\x10\x42\x61\x63kupCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12 \n\x0b\x63luster_uid\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x35\n\x07\x63luster\x18\x04 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12:\n\x07kms_key\x18\x05 \x01(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12\x18\n\x03uid\x18\x06 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01:\x9f\x01\xea\x41\x9b\x01\n%redis.googleapis.com/BackupCollection\x12Mprojects/{project}/locations/{location}/backupCollections/{backup_collection}*\x11\x62\x61\x63kupCollections2\x10\x62\x61\x63kupCollection\"\x9b\x08\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x07\x63luster\x18\x03 \x01(\tB$\xe0\x41\x03\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12 \n\x0b\x63luster_uid\x18\x04 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1d\n\x10total_size_bytes\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x65ngine_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12I\n\x0c\x62\x61\x63kup_files\x18\x08 \x03(\x0b\x32..google.cloud.redis.cluster.v1beta1.BackupFileB\x03\xe0\x41\x03\x12\x44\n\tnode_type\x18\t \x01(\x0e\x32,.google.cloud.redis.cluster.v1beta1.NodeTypeB\x03\xe0\x41\x03\x12\x1a\n\rreplica_count\x18\n \x01(\x05\x42\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12O\n\x0b\x62\x61\x63kup_type\x18\x0c \x01(\x0e\x32\x35.google.cloud.redis.cluster.v1beta1.Backup.BackupTypeB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\r \x01(\x0e\x32\x30.google.cloud.redis.cluster.v1beta1.Backup.StateB\x03\xe0\x41\x03\x12P\n\x0f\x65ncryption_info\x18\x0e \x01(\x0b\x32\x32.google.cloud.redis.cluster.v1beta1.EncryptionInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x0f \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"G\n\nBackupType\x12\x1b\n\x17\x42\x41\x43KUP_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\r\n\tSUSPENDED\x10\x04:\x92\x01\xea\x41\x8e\x01\n\x1bredis.googleapis.com/Backup\x12^projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kup\"s\n\nBackupFile\x12\x16\n\tfile_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x89\x01\n\x14PscServiceAttachment\x12\x1f\n\x12service_attachment\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x92\x07\n\x1d\x43rossClusterReplicationConfig\x12\x63\n\x0c\x63luster_role\x18\x01 \x01(\x0e\x32M.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole\x12h\n\x0fprimary_cluster\x18\x02 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12k\n\x12secondary_clusters\x18\x03 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\nmembership\x18\x05 \x01(\x0b\x32L.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.MembershipB\x03\xe0\x41\x03\x1aU\n\rRemoteCluster\x12\x32\n\x07\x63luster\x18\x01 \x01(\tB!\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\xed\x01\n\nMembership\x12m\n\x0fprimary_cluster\x18\x01 \x01(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\x12p\n\x12secondary_clusters\x18\x02 \x03(\x0b\x32O.google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteClusterB\x03\xe0\x41\x03\"Q\n\x0b\x43lusterRole\x12\x1c\n\x18\x43LUSTER_ROLE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0b\n\x07PRIMARY\x10\x02\x12\r\n\tSECONDARY\x10\x03\"\xed\x01\n\x18\x43lusterMaintenancePolicy\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x65\n\x19weekly_maintenance_window\x18\x03 \x03(\x0b\x32\x42.google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow\"q\n\x1e\x43lusterWeeklyMaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\"\x84\x01\n\x1a\x43lusterMaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"!\n\tPscConfig\x12\x14\n\x07network\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x84\x01\n\x11\x44iscoveryEndpoint\x12\x14\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x46\n\npsc_config\x18\x03 \x01(\x0b\x32-.google.cloud.redis.cluster.v1beta1.PscConfigB\x03\xe0\x41\x03\"\xe4\x03\n\rPscConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x02\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\n \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\\\n\x0f\x43lusterEndpoint\x12I\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x34.google.cloud.redis.cluster.v1beta1.ConnectionDetail\"\xc3\x01\n\x10\x43onnectionDetail\x12T\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x35.google.cloud.redis.cluster.v1beta1.PscAutoConnectionH\x00\x12K\n\x0epsc_connection\x18\x02 \x01(\x0b\x32\x31.google.cloud.redis.cluster.v1beta1.PscConnectionH\x00\x42\x0c\n\nconnection\"\xe8\x03\n\x11PscAutoConnection\x12\x1e\n\x11psc_connection_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x46\n\x0f\x66orwarding_rule\x18\x03 \x01(\tB-\xe0\x41\x03\xfa\x41\'\n%compute.googleapis.com/ForwardingRule\x12\x17\n\nproject_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12L\n\x12service_attachment\x18\x06 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12[\n\x15psc_connection_status\x18\x08 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.PscConnectionStatusB\x03\xe0\x41\x03\x12P\n\x0f\x63onnection_type\x18\t \x01(\x0e\x32\x32.google.cloud.redis.cluster.v1beta1.ConnectionTypeB\x03\xe0\x41\x03\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x8f\x04\n\x14\x43\x65rtificateAuthority\x12q\n\x11managed_server_ca\x18\x01 \x01(\x0b\x32T.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x1a\xb2\x01\n\x1bManagedCertificateAuthority\x12p\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32^.google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xae\x01\xea\x41\xaa\x01\n)redis.googleapis.com/CertificateAuthority\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\xa0\x07\n\x18\x43lusterPersistenceConfig\x12_\n\x04mode\x18\x01 \x01(\x0e\x32L.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12_\n\nrdb_config\x18\x02 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12_\n\naof_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xbf\x02\n\tRDBConfig\x12w\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32U.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xc9\x01\n\tAOFConfig\x12m\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32R.google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"M\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\x06\n\x02NO\x10\x01\x12\x0c\n\x08\x45VERYSEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\xf0\x01\n\x16ZoneDistributionConfig\x12\x62\n\x04mode\x18\x01 \x01(\x0e\x32O.google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xdc\x02\n#RescheduleClusterMaintenanceRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1credis.googleapis.com/Cluster\x12t\n\x0freschedule_type\x18\x02 \x01(\x0e\x32V.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\x84\x05\n\x0e\x45ncryptionInfo\x12U\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x37.google.cloud.redis.cluster.v1beta1.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x62\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32>.google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*\x83\x01\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12 \n\x1cPSC_CONNECTION_STATUS_ACTIVE\x10\x01\x12#\n\x1fPSC_CONNECTION_STATUS_NOT_FOUND\x10\x02*^\n\x11\x41uthorizationMode\x12\x19\n\x15\x41UTH_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41UTH_MODE_IAM_AUTH\x10\x01\x12\x16\n\x12\x41UTH_MODE_DISABLED\x10\x02*\x8f\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16REDIS_SHARED_CORE_NANO\x10\x01\x12\x18\n\x14REDIS_HIGHMEM_MEDIUM\x10\x02\x12\x18\n\x14REDIS_HIGHMEM_XLARGE\x10\x03\x12\x18\n\x14REDIS_STANDARD_SMALL\x10\x04*\x99\x01\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12$\n TRANSIT_ENCRYPTION_MODE_DISABLED\x10\x01\x12\x31\n-TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\xc4\x19\n\x11\x43loudRedisCluster\x12\xc5\x01\n\x0cListClusters\x12\x37.google.cloud.redis.cluster.v1beta1.ListClustersRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.ListClustersResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/clusters\x12\xb2\x01\n\nGetCluster\x12\x35.google.cloud.redis.cluster.v1beta1.GetClusterRequest\x1a+.google.cloud.redis.cluster.v1beta1.Cluster\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xec\x01\n\rUpdateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xd9\x01\n\rDeleteCluster\x12\x38.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/clusters/*}\x12\xe9\x01\n\rCreateCluster\x12\x38.google.cloud.redis.cluster.v1beta1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02<\"1/v1beta1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xfc\x01\n\x1eGetClusterCertificateAuthority\x12I.google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest\x1a\x38.google.cloud.redis.cluster.v1beta1.CertificateAuthority\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1beta1/{name=projects/*/locations/*/clusters/*/certificateAuthority}\x12\xa8\x02\n\x1cRescheduleClusterMaintenance\x12G.google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02S\"N/v1beta1/{name=projects/*/locations/*/clusters/*}:rescheduleClusterMaintenance:\x01*\x12\xe9\x01\n\x15ListBackupCollections\x12@.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest\x1a\x41.google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/backupCollections\x12\xd6\x01\n\x13GetBackupCollection\x12>.google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest\x1a\x34.google.cloud.redis.cluster.v1beta1.BackupCollection\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{name=projects/*/locations/*/backupCollections/*}\x12\xd5\x01\n\x0bListBackups\x12\x36.google.cloud.redis.cluster.v1beta1.ListBackupsRequest\x1a\x37.google.cloud.redis.cluster.v1beta1.ListBackupsResponse\"U\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xc2\x01\n\tGetBackup\x12\x34.google.cloud.redis.cluster.v1beta1.GetBackupRequest\x1a*.google.cloud.redis.cluster.v1beta1.Backup\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xeb\x01\n\x0c\x44\x65leteBackup\x12\x37.google.cloud.redis.cluster.v1beta1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46*D/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xde\x01\n\x0c\x45xportBackup\x12\x37.google.cloud.redis.cluster.v1beta1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x1d\n\x06\x42\x61\x63kup\x12\x13google.protobuf.Any\x82\xd3\xe4\x93\x02P\"K/v1beta1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xd5\x01\n\rBackupCluster\x12\x38.google.cloud.redis.cluster.v1beta1.BackupClusterRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x1e\n\x07\x43luster\x12\x13google.protobuf.Any\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta1/{name=projects/*/locations/*/clusters/*}:backup:\x01*\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8e\x06\n&com.google.cloud.redis.cluster.v1beta1B\x16\x43loudRedisClusterProtoP\x01Z@cloud.google.com/go/redis/cluster/apiv1beta1/clusterpb;clusterpb\xea\x02&Google::Cloud::Redis::Cluster::V1beta1\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -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.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.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 Cluster - module V1beta1 - CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CreateClusterRequest").msgclass - ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersRequest").msgclass - ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListClustersResponse").msgclass - UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.UpdateClusterRequest").msgclass - GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterRequest").msgclass - DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteClusterRequest").msgclass - GetClusterCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetClusterCertificateAuthorityRequest").msgclass - ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsRequest").msgclass - ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupCollectionsResponse").msgclass - GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupCollectionRequest").msgclass - ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsRequest").msgclass - ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ListBackupsResponse").msgclass - GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.GetBackupRequest").msgclass - DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DeleteBackupRequest").msgclass - ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ExportBackupRequest").msgclass - BackupClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupClusterRequest").msgclass - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster").msgclass - Cluster::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo").msgclass - Cluster::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo").msgclass - Cluster::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.GcsBackupSource").msgclass - Cluster::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.ManagedBackupSource").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Cluster.State").enummodule - AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig").msgclass - AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.FixedFrequencySchedule").msgclass - AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AutomatedBackupConfig.AutomatedBackupMode").enummodule - BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupCollection").msgclass - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup").msgclass - Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.BackupType").enummodule - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.Backup.State").enummodule - BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.BackupFile").msgclass - PscServiceAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscServiceAttachment").msgclass - CrossClusterReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig").msgclass - CrossClusterReplicationConfig::RemoteCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.RemoteCluster").msgclass - CrossClusterReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.Membership").msgclass - CrossClusterReplicationConfig::ClusterRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CrossClusterReplicationConfig.ClusterRole").enummodule - ClusterMaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenancePolicy").msgclass - ClusterWeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterWeeklyMaintenanceWindow").msgclass - ClusterMaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterMaintenanceSchedule").msgclass - PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConfig").msgclass - DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint").msgclass - PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnection").msgclass - ClusterEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterEndpoint").msgclass - ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionDetail").msgclass - PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscAutoConnection").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.OperationMetadata").msgclass - CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority").msgclass - CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass - ClusterPersistenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig").msgclass - ClusterPersistenceConfig::RDBConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig").msgclass - ClusterPersistenceConfig::RDBConfig::SnapshotPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.RDBConfig.SnapshotPeriod").enummodule - ClusterPersistenceConfig::AOFConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig").msgclass - ClusterPersistenceConfig::AOFConfig::AppendFsync = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.AOFConfig.AppendFsync").enummodule - ClusterPersistenceConfig::PersistenceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ClusterPersistenceConfig.PersistenceMode").enummodule - ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig").msgclass - ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ZoneDistributionConfig.ZoneDistributionMode").enummodule - RescheduleClusterMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest").msgclass - RescheduleClusterMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.RescheduleClusterMaintenanceRequest.RescheduleType").enummodule - EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo").msgclass - EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.Type").enummodule - EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.EncryptionInfo.KmsKeyState").enummodule - PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.PscConnectionStatus").enummodule - AuthorizationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.AuthorizationMode").enummodule - NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.NodeType").enummodule - TransitEncryptionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.TransitEncryptionMode").enummodule - ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.redis.cluster.v1beta1.ConnectionType").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb deleted file mode 100644 index 1c3cba0b9031..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb.rb +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto for package 'Google.Cloud.Redis.Cluster.V1beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb' - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - module CloudRedisCluster - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.redis.cluster.v1beta1.CloudRedisCluster' - - # Lists all Redis clusters owned by a project in either the specified - # location (region) or all locations. - # - # The location should have the following format: - # - # * `projects/{project_id}/locations/{location_id}` - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListClusters, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse - # Gets the details of a specific Redis cluster. - rpc :GetCluster, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Cluster - # Updates the metadata and configuration of a specific Redis cluster. - # - # Completed longrunning.Operation will contain the new cluster object - # in the response field. The returned operation is automatically deleted - # after a few hours, so there is no need to call DeleteOperation. - rpc :UpdateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, ::Google::Longrunning::Operation - # Deletes a specific Redis cluster. Cluster stops serving and data is - # deleted. - rpc :DeleteCluster, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, ::Google::Longrunning::Operation - # Creates a Redis cluster based on the specified properties. - # The creation is executed asynchronously and callers may check the returned - # operation to track its progress. Once the operation is completed the Redis - # cluster will be fully functional. The completed longrunning.Operation will - # contain the new cluster object in the response field. - # - # The returned operation is automatically deleted after a few hours, so there - # is no need to call DeleteOperation. - rpc :CreateCluster, ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, ::Google::Longrunning::Operation - # Gets the details of certificate authority information for Redis cluster. - rpc :GetClusterCertificateAuthority, ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority - # Reschedules upcoming maintenance event. - rpc :RescheduleClusterMaintenance, ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, ::Google::Longrunning::Operation - # Lists all backup collections owned by a consumer project in either the - # specified location (region) or all locations. - # - # If `location_id` is specified as `-` (wildcard), then all regions - # available to the project are queried, and the results are aggregated. - rpc :ListBackupCollections, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse - # Get a backup collection. - rpc :GetBackupCollection, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection - # Lists all backups owned by a backup collection. - rpc :ListBackups, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse - # Gets the details of a specific backup. - rpc :GetBackup, ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, ::Google::Cloud::Redis::Cluster::V1beta1::Backup - # Deletes a specific backup. - rpc :DeleteBackup, ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, ::Google::Longrunning::Operation - # Exports a specific backup to a customer target Cloud Storage URI. - rpc :ExportBackup, ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, ::Google::Longrunning::Operation - # Backup Redis Cluster. - # If this is the first time a backup is being created, a backup collection - # will be created at the backend, and this backup belongs to this collection. - # Both collection and backup will have a resource name. Backup will be - # executed for each shard. A replica (primary if nonHA) will be selected to - # perform the execution. Backup call will be rejected if there is an ongoing - # backup or update operation. Be aware that during preview, if the cluster's - # internal software version is too old, critical update will be performed - # before actual backup. Once the internal software version is updated to the - # minimum version required by the backup feature, subsequent backups will not - # require critical update. After preview, there will be no critical update - # needed for backup. - rpc :BackupCluster, ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb deleted file mode 100644 index 8c0c0259da61..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/rest.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" -require "google/cloud/redis/cluster/v1beta1/bindings_override" -require "google/cloud/redis/cluster/v1beta1/version" - -module Google - module Cloud - module Redis - module Cluster - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/redis/cluster/v1beta1/rest" - # client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new - # - module V1beta1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb deleted file mode 100644 index 5aa210ce32bc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/lib/google/cloud/redis/cluster/v1beta1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md deleted file mode 100644 index fdace2b045a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud Memorystore for Redis V1BETA1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb deleted file mode 100644 index 1a25774de845..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.rb +++ /dev/null @@ -1,1301 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Redis - module Cluster - module V1beta1 - # Request for [CreateCluster][CloudRedis.CreateCluster]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The logical name of the Redis cluster in the customer project - # with the following restrictions: - # - # * Must contain only lowercase letters, numbers, and hyphens. - # * Must start with a letter. - # * Must be between 1-63 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project / location - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # Required. The cluster that is to be created. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster location using the form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The `next_page_token` value returned from a previous - # [ListClusters][CloudRedis.ListClusters] request, if any. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListClusters][CloudRedis.ListClusters]. - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>] - # A list of Redis clusters in the project in the specified location, - # or across all locations. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # Redis entry is included in the response with the `name` field set to a - # value of the form - # `projects/{project_id}/locations/{location_id}/clusters/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListClusters". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [UpdateCluster][CloudRedis.UpdateCluster]. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask of fields to update. At least one path must be supplied in - # this field. The elements of the repeated paths field may only include these - # fields from {::Google::Cloud::Redis::Cluster::V1beta1::Cluster Cluster}: - # - # * `size_gb` - # * `replica_count` - # @!attribute [rw] cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster] - # Required. Update description. - # Only fields specified in update_mask are updated. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetCluster][CloudRedis.GetCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteCluster][CloudRedis.DeleteCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] request_id - # @return [::String] - # Idempotent request UUID. - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # [GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster certificate authority resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority` - # where `location_id` refers to a GCP region. - class GetClusterCertificateAuthorityRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackupCollections] - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection location using the - # form: - # `projects/{project_id}/locations/{location_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupCollectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackupCollections]. - # @!attribute [rw] backup_collections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>] - # A list of backupCollections in the project. - # - # If the `location_id` in the parent field of the request is "-", all regions - # available to the project are queried, and the results aggregated. - # If in such an aggregated query a location is unavailable, a placeholder - # backupCollection entry is included in the response with the `name` field - # set to a value of the form - # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the - # `status` field set to ERROR and `status_message` field set to "location not - # available for ListBackupCollections". - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListBackupCollectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackupCollection]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backupCollection resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # where `location_id` refers to a GCP region. - class GetBackupCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ListBackups]. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the backupCollection using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return. - # - # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # {::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse#next_page_token `next_page_token`} - # to determine if there are more clusters left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The `next_page_token` value returned from a previous - # [ListBackupCollections] request, if any. - class ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for [ListBackups]. - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::Backup>] - # A list of backups in the project. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Backups that could not be reached. - class ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [GetBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [DeleteBackup]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. Idempotent request UUID. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [ExportBackup]. - # @!attribute [rw] gcs_bucket - # @return [::String] - # Google Cloud Storage bucket, like "my-bucket". - # @!attribute [rw] name - # @return [::String] - # Required. Redis backup resource name using the form: - # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` - class ExportBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for [BackupCluster]. - # @!attribute [rw] name - # @return [::String] - # Required. Redis cluster resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. - # If not specified, the default value is 100 years. - # @!attribute [rw] backup_id - # @return [::String] - # Optional. The id of the backup to be created. If not specified, the - # default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used. - class BackupClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cluster instance. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::GcsBackupSource] - # Optional. Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # Read permission is required to import from the provided Cloud Storage - # objects. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] managed_backup_source - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::ManagedBackupSource] - # Optional. Backups generated and managed by memorystore service. - # - # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. Identifier. Unique name of the resource in this scope including - # project and location using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp associated with the cluster creation request. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::State] - # Output only. The current state of this cluster. - # Can be CREATING, READY, UPDATING, DELETING and SUSPENDED - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned, unique identifier for the cluster. - # @!attribute [rw] replica_count - # @return [::Integer] - # Optional. The number of replica nodes per shard. - # @!attribute [rw] authorization_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AuthorizationMode] - # Optional. The authorization mode of the Redis cluster. - # If not provided, auth feature is disabled for the cluster. - # @!attribute [rw] transit_encryption_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::TransitEncryptionMode] - # Optional. The in-transit encryption for the Redis cluster. - # If not provided, encryption is disabled for the cluster. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Redis memory size in GB for the entire cluster rounded up to - # the next integer. - # @!attribute [rw] shard_count - # @return [::Integer] - # Optional. Number of shards for the Redis cluster. - # @!attribute [rw] psc_configs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConfig>] - # Optional. Each PscConfig configures the consumer network where IPs will - # be designated to the cluster for client access through Private Service - # Connect Automation. Currently, only one PscConfig is supported. - # @!attribute [r] discovery_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::DiscoveryEndpoint>] - # Output only. Endpoints created on each given network, for Redis clients to - # connect to the cluster. Currently only one discovery endpoint is supported. - # @!attribute [r] psc_connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscConnection>] - # Output only. The list of PSC connections that are auto-created through - # service connectivity automation. - # @!attribute [r] state_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo] - # Output only. Additional information about the current state of the cluster. - # @!attribute [rw] node_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] - # Optional. The type of a redis node in the cluster. NodeType determines the - # underlying machine-type of a redis node. - # @!attribute [rw] persistence_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig] - # Optional. Persistence config (RDB, AOF) for the cluster. - # @!attribute [rw] redis_configs - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Key/Value pairs of customer overrides for mutable Redis Configs - # @!attribute [r] precise_size_gb - # @return [::Float] - # Output only. Precise value of redis memory size in GB for the entire - # cluster. - # @!attribute [rw] zone_distribution_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig] - # Optional. This config will be used to determine how the customer wants us - # to distribute cluster resources within the region. - # @!attribute [rw] cross_cluster_replication_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig] - # Optional. Cross cluster replication config. - # @!attribute [rw] deletion_protection_enabled - # @return [::Boolean] - # Optional. The delete operation will fail when the value is set to true. - # @!attribute [rw] maintenance_policy - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenancePolicy] - # Optional. ClusterMaintenancePolicy determines when to allow or deny - # updates. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterMaintenanceSchedule] - # Output only. ClusterMaintenanceSchedule Output only Published maintenance - # schedule. - # @!attribute [r] psc_service_attachments - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::PscServiceAttachment>] - # Output only. Service attachment details to configure Psc connections - # @!attribute [rw] cluster_endpoints - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterEndpoint>] - # Optional. A list of cluster enpoints. - # @!attribute [r] backup_collection - # @return [::String] - # Optional. Output only. The backup collection full resource name. Example: - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} - # @!attribute [rw] kms_key - # @return [::String] - # Optional. The KMS key used to encrypt the at-rest data of the cluster. - # @!attribute [rw] automated_backup_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig] - # Optional. The automated backup config for the cluster. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] - # Output only. Encryption information of the data at rest of the cluster. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents additional information about the state of the cluster. - # @!attribute [rw] update_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Cluster::StateInfo::UpdateInfo] - # Describes ongoing update on the cluster when cluster state is UPDATING. - class StateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents information about an updating cluster. - # @!attribute [rw] target_shard_count - # @return [::Integer] - # Target number of shards for redis cluster - # @!attribute [rw] target_replica_count - # @return [::Integer] - # Target number of replica nodes per shard. - class UpdateInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Backups stored in Cloud Storage buckets. - # The Cloud Storage buckets need to be the same region as the clusters. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Optional. URIs of the GCS objects to import. - # Example: gs://bucket1/object1, gs://bucket2/folder2/object2 - class GcsBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backups that generated and managed by memorystore. - # @!attribute [rw] backup - # @return [::String] - # Optional. Example: - # //redis.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} - # A shorter version (without the prefix) of the backup name is also - # supported, like - # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} - # In this case, it assumes the backup is under redis.googleapis.com. - class ManagedBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RedisConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states of a Redis cluster. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # Redis cluster is being created. - CREATING = 1 - - # Redis cluster has been created and is fully usable. - ACTIVE = 2 - - # Redis cluster configuration is being updated. - UPDATING = 3 - - # Redis cluster is being deleted. - DELETING = 4 - end - end - - # The automated backup config for a cluster. - # @!attribute [rw] fixed_frequency_schedule - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::FixedFrequencySchedule] - # Optional. Trigger automated backups at a fixed frequency. - # @!attribute [rw] automated_backup_mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::AutomatedBackupConfig::AutomatedBackupMode] - # Optional. The automated backup mode. If the mode is disabled, the other - # fields will be ignored. - # @!attribute [rw] retention - # @return [::Google::Protobuf::Duration] - # Optional. How long to keep automated backups before the backups are - # deleted. The value should be between 1 day and 365 days. If not specified, - # the default value is 35 days. - class AutomatedBackupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This schedule allows the backup to be triggered at a fixed frequency - # (currently only daily is supported). - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Required. The start time of every automated backup in UTC. It must be set - # to the start of an hour. This field is required. - class FixedFrequencySchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The automated backup mode. - module AutomatedBackupMode - # Default value. Automated backup config is not specified. - AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 - - # Automated backup config disabled. - DISABLED = 1 - - # Automated backup config enabled. - ENABLED = 2 - end - end - - # BackupCollection of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup collection. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. The cluster uid of the backup collection. - # @!attribute [r] cluster - # @return [::String] - # Output only. The full resource path of the cluster the backup collection - # belongs to. Example: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @!attribute [r] kms_key - # @return [::String] - # Output only. The KMS key used to encrypt the backups under this backup - # collection. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup collection. - class BackupCollection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backup of a cluster. - # @!attribute [rw] name - # @return [::String] - # Identifier. Full resource path of the backup. the last part of the name is - # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Cluster - # UID] OR customer specified while backup cluster. Example: - # 20240515123000_1234 - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup was created. - # @!attribute [r] cluster - # @return [::String] - # Output only. Cluster resource path of this backup. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. Cluster uid of this backup. - # @!attribute [r] total_size_bytes - # @return [::Integer] - # Output only. Total size of the backup in bytes. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup will expire. - # @!attribute [r] engine_version - # @return [::String] - # Output only. redis-7.2, valkey-7.5 - # @!attribute [r] backup_files - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::BackupFile>] - # Output only. List of backup files of the backup. - # @!attribute [r] node_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::NodeType] - # Output only. Node type of the cluster. - # @!attribute [r] replica_count - # @return [::Integer] - # Output only. Number of replicas for the cluster. - # @!attribute [r] shard_count - # @return [::Integer] - # Output only. Number of shards for the cluster. - # @!attribute [r] backup_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::BackupType] - # Output only. Type of the backup. - # @!attribute [r] state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::Backup::State] - # Output only. State of the backup. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo] - # Output only. Encryption information of the backup. - # @!attribute [r] uid - # @return [::String] - # Output only. System assigned unique identifier of the backup. - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the backup. - module BackupType - # The default value, not set. - BACKUP_TYPE_UNSPECIFIED = 0 - - # On-demand backup. - ON_DEMAND = 1 - - # Automated backup. - AUTOMATED = 2 - end - - # State of the backup. - module State - # The default value, not set. - STATE_UNSPECIFIED = 0 - - # The backup is being created. - CREATING = 1 - - # The backup is active to be used. - ACTIVE = 2 - - # The backup is being deleted. - DELETING = 3 - - # The backup is currently suspended due to reasons like project deletion, - # billing account closure, etc. - SUSPENDED = 4 - end - end - - # Backup is consisted of multiple backup files. - # @!attribute [r] file_name - # @return [::String] - # Output only. e.g: .rdb - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. Size of the backup file in bytes. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the backup file was created. - class BackupFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of a service attachment of the cluster, for creating PSC - # connections. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. Service attachment URI which your self-created PscConnection - # should use as target - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of a PSC connection targeting this service attachment. - class PscServiceAttachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cross cluster replication config. - # @!attribute [rw] cluster_role - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::ClusterRole] - # The role of the cluster in cross cluster replication. - # @!attribute [rw] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] - # Details of the primary cluster that is used as the replication source for - # this secondary cluster. - # - # This field is only set for a secondary cluster. - # @!attribute [rw] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] - # List of secondary clusters that are replicating from this primary cluster. - # - # This field is only set for a primary cluster. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time cross cluster replication config was updated. - # @!attribute [r] membership - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::Membership] - # Output only. An output only view of all the member clusters participating - # in the cross cluster replication. This view will be provided by every - # member cluster irrespective of its cluster role(primary or secondary). - # - # A primary cluster can provide information about all the secondary clusters - # replicating from it. However, a secondary cluster only knows about the - # primary cluster from which it is replicating. However, for scenarios, where - # the primary cluster is unavailable(e.g. regional outage), a GetCluster - # request can be sent to any other member cluster and this field will list - # all the member clusters participating in cross cluster replication. - class CrossClusterReplicationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details of the remote cluster associated with this cluster in a cross - # cluster replication setup. - # @!attribute [rw] cluster - # @return [::String] - # The full resource path of the remote cluster in - # the format: projects//locations//clusters/ - # @!attribute [r] uid - # @return [::String] - # Output only. The unique identifier of the remote cluster. - class RemoteCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An output only view of all the member clusters participating in the cross - # cluster replication. - # @!attribute [r] primary_cluster - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster] - # Output only. The primary cluster that acts as the source of replication - # for the secondary clusters. - # @!attribute [r] secondary_clusters - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CrossClusterReplicationConfig::RemoteCluster>] - # Output only. The list of secondary clusters replicating from the primary - # cluster. - class Membership - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The role of the cluster in cross cluster replication. - module ClusterRole - # Cluster role is not set. - # The behavior is equivalent to NONE. - CLUSTER_ROLE_UNSPECIFIED = 0 - - # This cluster does not participate in cross cluster replication. It is an - # independent cluster and does not replicate to or from any other clusters. - NONE = 1 - - # A cluster that allows both reads and writes. Any data written to this - # cluster is also replicated to the attached secondary clusters. - PRIMARY = 2 - - # A cluster that allows only reads and replicates data from a primary - # cluster. - SECONDARY = 3 - end - end - - # Maintenance policy per cluster. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was created i.e. Maintenance Window - # or Deny Period was assigned. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy was updated i.e. Maintenance Window - # or Deny Period was updated. - # @!attribute [rw] weekly_maintenance_window - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ClusterWeeklyMaintenanceWindow>] - # Optional. Maintenance window that is applied to resources covered by this - # policy. Minimum 1. For the current version, the maximum number of - # weekly_maintenance_window is expected to be one. - class ClusterMaintenancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Time window specified for weekly operations. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Allows to define schedule that runs specified day of the week. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Start time of the window in UTC. - class ClusterWeeklyMaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upcoming maitenance schedule. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The start time of any upcoming scheduled maintenance for this - # instance. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The end time of any upcoming scheduled maintenance for this - # instance. - class ClusterMaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] network - # @return [::String] - # Required. The network where the IP address of the discovery endpoint will - # be reserved, in the form of - # projects/\\{network_project}/global/networks/\\{network_id}. - class PscConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpoints on each network, for Redis clients to connect to the cluster. - # @!attribute [r] address - # @return [::String] - # Output only. Address of the exposed Redis endpoint used by clients to - # connect to the service. The address could be either IP or hostname. - # @!attribute [r] port - # @return [::Integer] - # Output only. The port number of the exposed Redis endpoint. - # @!attribute [r] psc_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConfig] - # Output only. Customer configuration for where the endpoint is created and - # accessed from. - class DiscoveryEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection. - # @!attribute [rw] psc_connection_id - # @return [::String] - # Required. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [rw] address - # @return [::String] - # Required. The IP allocated on the consumer network for the PSC forwarding - # rule. - # @!attribute [rw] forwarding_rule - # @return [::String] - # Required. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Optional. Project ID of the consumer project where the forwarding rule is - # created in. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [rw] service_attachment - # @return [::String] - # Required. The service attachment which is the target of the PSC connection, - # in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # To get the latest status of a PSC connection, follow - # https://cloud.google.com/vpc/docs/configure-private-service-connect-services#endpoint-details. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of the PSC connection. - class PscConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ClusterEndpoint consists of PSC connections that are created - # as a group in each VPC network for accessing the cluster. In each group, - # there shall be one connection for each service attachment in the cluster. - # @!attribute [rw] connections - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::ConnectionDetail>] - # A group of PSC connections. They are created in the same VPC network, one - # for each service attachment in the cluster. - class ClusterEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed information of each PSC connection. - # @!attribute [rw] psc_auto_connection - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscAutoConnection] - # Detailed information of a PSC connection that is created through - # service connectivity automation. - # - # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] psc_connection - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnection] - # Detailed information of a PSC connection that is created by the customer - # who owns the cluster. - # - # Note: The following fields are mutually exclusive: `psc_connection`, `psc_auto_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ConnectionDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of consumer resources in a PSC connection that is created through - # Service Connectivity Automation. - # @!attribute [r] psc_connection_id - # @return [::String] - # Output only. The PSC connection id of the forwarding rule connected to the - # service attachment. - # @!attribute [r] address - # @return [::String] - # Output only. The IP allocated on the consumer network for the PSC - # forwarding rule. - # @!attribute [r] forwarding_rule - # @return [::String] - # Output only. The URI of the consumer side forwarding rule. - # Example: - # projects/\\{projectNumOrId}/regions/us-east1/forwardingRules/\\{resourceId}. - # @!attribute [rw] project_id - # @return [::String] - # Required. The consumer project_id where the forwarding rule is created - # from. - # @!attribute [rw] network - # @return [::String] - # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. - # @!attribute [r] service_attachment - # @return [::String] - # Output only. The service attachment which is the target of the PSC - # connection, in the form of - # projects/\\{project-id}/regions/\\{region}/serviceAttachments/\\{service-attachment-id}. - # @!attribute [r] psc_connection_status - # @return [::Google::Cloud::Redis::Cluster::V1beta1::PscConnectionStatus] - # Output only. The status of the PSC connection. - # Please note that this value is updated periodically. - # Please use Private Service Connect APIs for the latest status. - # @!attribute [r] connection_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ConnectionType] - # Output only. Type of the PSC connection. - class PscAutoConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pre-defined metadata fields. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Redis cluster certificate authority - # @!attribute [rw] managed_server_ca - # @return [::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority] - # @!attribute [rw] name - # @return [::String] - # Identifier. Unique name of the resource in this scope including project, - # location and cluster using the form: - # `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthority` - class CertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] ca_certs - # @return [::Array<::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority::ManagedCertificateAuthority::CertChain>] - # The PEM encoded CA certificate chains for redis managed - # server authentication - class ManagedCertificateAuthority - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] certificates - # @return [::Array<::String>] - # The certificates that form the CA chain, from leaf to root order. - class CertChain - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration of the persistence functionality. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::PersistenceMode] - # Optional. The mode of persistence. - # @!attribute [rw] rdb_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig] - # Optional. RDB configuration. This field will be ignored if mode is not RDB. - # @!attribute [rw] aof_config - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig] - # Optional. AOF configuration. This field will be ignored if mode is not AOF. - class ClusterPersistenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of the RDB based persistence. - # @!attribute [rw] rdb_snapshot_period - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::RDBConfig::SnapshotPeriod] - # Optional. Period between RDB snapshots. - # @!attribute [rw] rdb_snapshot_start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time that the first snapshot was/will be attempted, and to - # which future snapshots will be aligned. If not provided, the current time - # will be used. - class RDBConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available snapshot periods. - module SnapshotPeriod - # Not set. - SNAPSHOT_PERIOD_UNSPECIFIED = 0 - - # One hour. - ONE_HOUR = 1 - - # Six hours. - SIX_HOURS = 2 - - # Twelve hours. - TWELVE_HOURS = 3 - - # Twenty four hours. - TWENTY_FOUR_HOURS = 4 - end - end - - # Configuration of the AOF based persistence. - # @!attribute [rw] append_fsync - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ClusterPersistenceConfig::AOFConfig::AppendFsync] - # Optional. fsync configuration. - class AOFConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Available fsync modes. - module AppendFsync - # Not set. Default: EVERYSEC - APPEND_FSYNC_UNSPECIFIED = 0 - - # Never fsync. Normally Linux will flush data every 30 seconds with this - # configuration, but it's up to the kernel's exact tuning. - NO = 1 - - # fsync every second. Fast enough, and you may lose 1 second of data if - # there is a disaster - EVERYSEC = 2 - - # fsync every time new write commands are appended to the AOF. It has the - # best data loss protection at the cost of performance - ALWAYS = 3 - end - end - - # Available persistence modes. - module PersistenceMode - # Not set. - PERSISTENCE_MODE_UNSPECIFIED = 0 - - # Persistence is disabled, and any snapshot data is deleted. - DISABLED = 1 - - # RDB based persistence is enabled. - RDB = 2 - - # AOF based persistence is enabled. - AOF = 3 - end - end - - # Zone distribution config for allocation of cluster resources. - # @!attribute [rw] mode - # @return [::Google::Cloud::Redis::Cluster::V1beta1::ZoneDistributionConfig::ZoneDistributionMode] - # Optional. The mode of zone distribution. Defaults to MULTI_ZONE, when not - # specified. - # @!attribute [rw] zone - # @return [::String] - # Optional. When SINGLE ZONE distribution is selected, zone field would be - # used to allocate all resources in that zone. This is not applicable to - # MULTI_ZONE, and would be ignored for MULTI_ZONE clusters. - class ZoneDistributionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines various modes of zone distribution. - module ZoneDistributionMode - # Not Set. Default: MULTI_ZONE - ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0 - - # Distribute all resources across 3 zones picked at random, within the - # region. - MULTI_ZONE = 1 - - # Distribute all resources in a single zone. The zone field must be - # specified, when this mode is selected. - SINGLE_ZONE = 2 - end - end - - # Request for rescheduling a cluster maintenance. - # @!attribute [rw] name - # @return [::String] - # Required. Redis Cluster instance resource name using the form: - # `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` - # where `location_id` refers to a GCP region. - # @!attribute [rw] reschedule_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest::RescheduleType] - # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as - # well. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp when the maintenance shall be rescheduled to if - # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for - # example `2012-11-15T16:19:00.094Z`. - class RescheduleClusterMaintenanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Reschedule options. - module RescheduleType - # Not set. - RESCHEDULE_TYPE_UNSPECIFIED = 0 - - # If the user wants to schedule the maintenance to happen now. - IMMEDIATE = 1 - - # If the user wants to reschedule the maintenance to a specific time. - SPECIFIC_TIME = 3 - end - end - - # EncryptionInfo describes the encryption information of a cluster or a backup. - # @!attribute [r] encryption_type - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::Type] - # Output only. Type of encryption. - # @!attribute [r] kms_key_versions - # @return [::Array<::String>] - # Output only. KMS key versions that are being used to protect the data - # at-rest. - # @!attribute [r] kms_key_primary_state - # @return [::Google::Cloud::Redis::Cluster::V1beta1::EncryptionInfo::KmsKeyState] - # Output only. The state of the primary version of the KMS key perceived by - # the system. This field is not populated in backups. - # @!attribute [r] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The most recent time when the encryption info was updated. - class EncryptionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible encryption types. - module Type - # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - TYPE_UNSPECIFIED = 0 - - # The data is encrypted at rest with a key that is fully managed by Google. - # No key version will be populated. This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1 - - # The data is encrypted at rest with a key that is managed by the customer. - # KMS key versions will be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2 - end - - # The state of the KMS key perceived by the system. Refer to the public - # documentation for the impact of each state. - module KmsKeyState - # The default value. This value is unused. - KMS_KEY_STATE_UNSPECIFIED = 0 - - # The KMS key is enabled and correctly configured. - ENABLED = 1 - - # Permission denied on the KMS key. - PERMISSION_DENIED = 2 - - # The KMS key is disabled. - DISABLED = 3 - - # The KMS key is destroyed. - DESTROYED = 4 - - # The KMS key is scheduled to be destroyed. - DESTROY_SCHEDULED = 5 - - # The EKM key is unreachable. - EKM_KEY_UNREACHABLE_DETECTED = 6 - - # Billing is disabled for the project. - BILLING_DISABLED = 7 - - # All other unknown failures. - UNKNOWN_FAILURE = 8 - end - end - - # Status of the PSC connection. - module PscConnectionStatus - # PSC connection status is not specified. - PSC_CONNECTION_STATUS_UNSPECIFIED = 0 - - # The connection is active - PSC_CONNECTION_STATUS_ACTIVE = 1 - - # Connection not found - PSC_CONNECTION_STATUS_NOT_FOUND = 2 - end - - # Available authorization mode of a Redis cluster. - module AuthorizationMode - # Not set. - AUTH_MODE_UNSPECIFIED = 0 - - # IAM basic authorization mode - AUTH_MODE_IAM_AUTH = 1 - - # Authorization disabled mode - AUTH_MODE_DISABLED = 2 - end - - # NodeType of a redis cluster node, - module NodeType - # Node type unspecified - NODE_TYPE_UNSPECIFIED = 0 - - # Redis shared core nano node_type. - REDIS_SHARED_CORE_NANO = 1 - - # Redis highmem medium node_type. - REDIS_HIGHMEM_MEDIUM = 2 - - # Redis highmem xlarge node_type. - REDIS_HIGHMEM_XLARGE = 3 - - # Redis standard small node_type. - REDIS_STANDARD_SMALL = 4 - end - - # Available mode of in-transit encryption. - module TransitEncryptionMode - # In-transit encryption not set. - TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 - - # In-transit encryption disabled. - TRANSIT_ENCRYPTION_MODE_DISABLED = 1 - - # Use server managed encryption for in-transit encryption. - TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2 - end - - # Type of a PSC connection, for cluster access purpose. - module ConnectionType - # Cluster endpoint Type is not set - CONNECTION_TYPE_UNSPECIFIED = 0 - - # Cluster endpoint that will be used as for cluster topology discovery. - CONNECTION_TYPE_DISCOVERY = 1 - - # Cluster endpoint that will be used as primary endpoint to access primary. - CONNECTION_TYPE_PRIMARY = 2 - - # Cluster endpoint that will be used as reader endpoint to access replicas. - CONNECTION_TYPE_READER = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index 973211b9ffe7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/proto_docs/google/type/timeofday.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a time of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile deleted file mode 100644 index df35534a4e02..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-redis-cluster-v1beta1", path: "../" -else - gem "google-cloud-redis-cluster-v1beta1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb deleted file mode 100644 index bf5ebfcda30d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/backup_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the backup_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster. -# -def backup_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new - - # Call the backup_cluster method. - result = client.backup_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb deleted file mode 100644 index 7638244dba94..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/create_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the create_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb deleted file mode 100644 index 19917b30490c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the delete_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb deleted file mode 100644 index fbc95553d4b7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/delete_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the delete_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb deleted file mode 100644 index 5ab68f801603..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/export_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the export_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup. -# -def export_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new - - # Call the export_backup method. - result = client.export_backup request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb deleted file mode 100644 index 7db2d5eecb49..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_backup call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Backup. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb deleted file mode 100644 index 766299664331..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_backup_collection.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_backup_collection call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection. -# -def get_backup_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new - - # Call the get_backup_collection method. - result = client.get_backup_collection request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb deleted file mode 100644 index 77e8fff246f1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::Cluster. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb deleted file mode 100644 index e5b88a2ead35..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/get_cluster_certificate_authority.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority. -# -def get_cluster_certificate_authority - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new - - # Call the get_cluster_certificate_authority method. - result = client.get_cluster_certificate_authority request - - # The returned object is of type Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority. - p result -end -# [END redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb deleted file mode 100644 index ad3986e233a3..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backup_collections.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_backup_collections call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections. -# -def list_backup_collections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new - - # Call the list_backup_collections method. - result = client.list_backup_collections request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb deleted file mode 100644 index cd01f47c1522..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_backups.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_backups call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new - - # Call the list_backups method. - result = client.list_backups request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Backup. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb deleted file mode 100644 index eecf60935fcf..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/list_clusters.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the list_clusters call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Redis::Cluster::V1beta1::Cluster. - p item - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb deleted file mode 100644 index 0f6991ad3882..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/reschedule_cluster_maintenance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance. -# -def reschedule_cluster_maintenance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new - - # Call the reschedule_cluster_maintenance method. - result = client.reschedule_cluster_maintenance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb deleted file mode 100644 index d626b00ee718..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/cloud_redis_cluster/update_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] -require "google/cloud/redis/cluster/v1beta1" - -## -# Snippet for the update_cluster call in the CloudRedisCluster service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json deleted file mode 100644 index 7e3369688058..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/snippets/snippet_metadata_google.cloud.redis.cluster.v1beta1.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-redis-cluster-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.redis.cluster.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync", - "title": "Snippet for the list_clusters call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters.", - "file": "cloud_redis_cluster/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListClusters", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync", - "title": "Snippet for the get_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster.", - "file": "cloud_redis_cluster/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Cluster", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster.", - "file": "cloud_redis_cluster/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.UpdateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster.", - "file": "cloud_redis_cluster/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster.", - "file": "cloud_redis_cluster/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.CreateCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetClusterCertificateAuthority_sync", - "title": "Snippet for the get_cluster_certificate_authority call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority.", - "file": "cloud_redis_cluster/get_cluster_certificate_authority.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster_certificate_authority", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_cluster_certificate_authority", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetClusterCertificateAuthority", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetClusterCertificateAuthority", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_RescheduleClusterMaintenance_sync", - "title": "Snippet for the reschedule_cluster_maintenance call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance.", - "file": "cloud_redis_cluster/reschedule_cluster_maintenance.rb", - "language": "RUBY", - "client_method": { - "short_name": "reschedule_cluster_maintenance", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#reschedule_cluster_maintenance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "RescheduleClusterMaintenance", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.RescheduleClusterMaintenance", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackupCollections_sync", - "title": "Snippet for the list_backup_collections call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections.", - "file": "cloud_redis_cluster/list_backup_collections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backup_collections", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backup_collections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackupCollections", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackupCollections", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackupCollection_sync", - "title": "Snippet for the get_backup_collection call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection.", - "file": "cloud_redis_cluster/get_backup_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup_collection", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackupCollection", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackupCollection", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ListBackups_sync", - "title": "Snippet for the list_backups call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups.", - "file": "cloud_redis_cluster/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ListBackups", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_GetBackup_sync", - "title": "Snippet for the get_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup.", - "file": "cloud_redis_cluster/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Redis::Cluster::V1beta1::Backup", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.GetBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup.", - "file": "cloud_redis_cluster/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.DeleteBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_ExportBackup_sync", - "title": "Snippet for the export_backup call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup.", - "file": "cloud_redis_cluster/export_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_backup", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#export_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "ExportBackup", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.ExportBackup", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "redis_v1beta1_generated_CloudRedisCluster_BackupCluster_sync", - "title": "Snippet for the backup_cluster call in the CloudRedisCluster service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster.", - "file": "cloud_redis_cluster/backup_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "backup_cluster", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client#backup_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CloudRedisCluster::Client", - "full_name": "::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client" - }, - "method": { - "short_name": "BackupCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster.BackupCluster", - "service": { - "short_name": "CloudRedisCluster", - "full_name": "google.cloud.redis.cluster.v1beta1.CloudRedisCluster" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb deleted file mode 100644 index 7d3baf4c1ca7..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb deleted file mode 100644 index 26bfd76d5d1c..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_backup_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" - assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path - end - end - - def test_backup_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" - assert_equal "projects/value0/locations/value1/backupCollections/value2", path - end - end - - def test_certificate_authority_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.certificate_authority_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2/certificateAuthority", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_crypto_key_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_forwarding_rule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" - assert_equal "projects/value0/regions/value1/forwardingRules/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_service_attachment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" - assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb deleted file mode 100644 index 906ca29bdc78..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_rest_test.rb +++ /dev/null @@ -1,873 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/rest" - - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_get_cluster_certificate_authority - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_certificate_authority_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_cluster_certificate_authority_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster_certificate_authority({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_certificate_authority_client_stub.call_count - end - end - end - - def test_reschedule_cluster_maintenance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_reschedule_cluster_maintenance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reschedule_cluster_maintenance_client_stub.call_count - end - end - end - - def test_list_backup_collections - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backup_collections_client_stub.call_count - end - end - end - - def test_get_backup_collection - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup_collection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup_collection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup_collection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_collection_client_stub.call_count - end - end - end - - def test_list_backups - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backups parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_backup({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_backup name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_backup({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_count - end - end - end - - def test_delete_backup - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_count - end - end - end - - def test_export_backup - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_backup_client_stub.call_count - end - end - end - - def test_backup_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::ServiceStub.stub :transcode_backup_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb deleted file mode 100644 index 5699b33b9472..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_test.rb +++ /dev/null @@ -1,1018 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_pb" -require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster" - -class ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_clusters parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Cluster.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Redis::Cluster::V1beta1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_rpc_count - end - end - - def test_get_cluster_certificate_authority - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster_certificate_authority, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_certificate_authority_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster_certificate_authority({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster_certificate_authority name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster_certificate_authority ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster_certificate_authority({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cluster_certificate_authority(::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cluster_certificate_authority_client_stub.call_rpc_count - end - end - - def test_reschedule_cluster_maintenance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED - schedule_time = {} - - reschedule_cluster_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reschedule_cluster_maintenance, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reschedule_cluster_maintenance_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.reschedule_cluster_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.reschedule_cluster_maintenance ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.reschedule_cluster_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.reschedule_cluster_maintenance(::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, reschedule_cluster_maintenance_client_stub.call_rpc_count - end - end - - def test_list_backup_collections - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backup_collections, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backup_collections ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backup_collections(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backup_collections_client_stub.call_rpc_count - end - end - - def test_get_backup_collection - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup_collection, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup_collection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup_collection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup_collection ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup_collection({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_backup_collection(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_backup_collection_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_backups, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_backups ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_backups(::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_backups_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::Redis::Cluster::V1beta1::Backup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_backup({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_backup name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_backup ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_backup({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_backup(::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_backup_client_stub.call_rpc_count - end - end - - def test_delete_backup - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_rpc_count - end - end - - def test_export_backup - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - gcs_bucket = "hello world" - name = "hello world" - - export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_backup, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest, request - assert_equal "hello world", request["gcs_bucket"] - assert_equal :gcs_bucket, request.destination - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_backup_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_backup ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_backup(::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, export_backup_client_stub.call_rpc_count - end - end - - def test_backup_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - ttl = {} - backup_id = "hello world" - - backup_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :backup_cluster, name - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] - assert_equal "hello world", request["backup_id"] - assert request.has_backup_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, backup_cluster_client_stub do - # Create client - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.backup_cluster name: name, ttl: ttl, backup_id: backup_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.backup_cluster ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.backup_cluster({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.backup_cluster(::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, backup_cluster_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster-v1beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster-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-cluster/.gitignore b/owl-bot-staging/google-cloud-redis-cluster/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json b/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json deleted file mode 100644 index a4eacf09bd79..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "redis.googleapis.com", - "api_shortname": "redis", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster/latest", - "distribution_name": "google-cloud-redis-cluster", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis API", - "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates and manages Redis instances on the Google Cloud Platform.", - "ruby-cloud-product-url": "https://cloud.google.com/memorystore/docs/cluster", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml b/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml deleted file mode 100644 index fb84f9ce2d5d..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis-cluster.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-cluster.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-redis-cluster/.toys.rb b/owl-bot-staging/google-cloud-redis-cluster/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/.yardopts b/owl-bot-staging/google-cloud-redis-cluster/.yardopts deleted file mode 100644 index 99a35e32f21f..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/.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-cluster/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md deleted file mode 100644 index b6045d2796c1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis-cluster library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-redis-cluster library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/redis/cluster" - -client = Google::Cloud::Redis::Cluster.cloud_redis_cluster do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis/cluster" - -Google::Cloud::Redis::Cluster.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Redis::Cluster.cloud_redis_cluster -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-redis-cluster -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/redis/cluster" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Redis::Cluster.cloud_redis_cluster -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md b/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis-cluster/Gemfile b/owl-bot-staging/google-cloud-redis-cluster/Gemfile deleted file mode 100644 index 246777aa5664..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-redis-cluster-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-redis-cluster.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-cluster/LICENSE.md b/owl-bot-staging/google-cloud-redis-cluster/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-redis-cluster/README.md b/owl-bot-staging/google-cloud-redis-cluster/README.md deleted file mode 100644 index 5b7fde792872..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Ruby Client 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-cluster-v*`. -The gem `google-cloud-redis-cluster` 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-cluster/latest) -for this library, google-cloud-redis-cluster, 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-cluster-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/cluster) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-redis-cluster -``` - -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/cluster" - -client = Google::Cloud::Redis::Cluster.cloud_redis_cluster -request = ::Google::Cloud::Redis::Cluster::V1::ListClustersRequest.new # (request fields as keyword arguments...) -response = client.list_clusters 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-cluster-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-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-cluster`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-redis-cluster-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-cluster`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-redis-cluster-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-cluster/Rakefile b/owl-bot-staging/google-cloud-redis-cluster/Rakefile deleted file mode 100644 index 2738a728b0eb..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/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-cluster acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/redis/cluster/v1/cloud_redis_cluster/credentials" - ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-redis-cluster gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-cluster gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-redis-cluster gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-redis-cluster gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis-cluster" - header "google-cloud-redis-cluster rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis-cluster yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis-cluster test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-redis-cluster smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-redis-cluster acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec b/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec deleted file mode 100644 index e1df54cff930..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/google-cloud-redis-cluster.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/cluster/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis-cluster" - gem.version = Google::Cloud::Redis::Cluster::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 = "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") + - ["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-cluster-v1", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.rb deleted file mode 100644 index 32acf287e53b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/lib/google-cloud-redis-cluster.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/cluster" unless defined? Google::Cloud::Redis::Cluster::VERSION diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.rb deleted file mode 100644 index a286b288acb1..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster.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! - -# 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/cluster/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_cluster 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 - module Cluster - ## - # Create a new client object for CloudRedisCluster. - # - # By default, this returns an instance of - # [Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-cluster-v1/latest/Google-Cloud-Redis-Cluster-V1-CloudRedisCluster-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 CloudRedisCluster 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 CloudRedisCluster service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Redis::Cluster.cloud_redis_cluster_available?}. - # - # ## About CloudRedisCluster - # - # Configures and manages Cloud Memorystore for Redis clusters - # - # Google Cloud Memorystore for Redis Cluster - # - # The `redis.googleapis.com` service implements the Google Cloud Memorystore - # for Redis API and defines the following resource model for managing Redis - # clusters: - # * The service works with a collection of cloud projects, named: `/projects/*` - # * Each project has a collection of available locations, named: `/locations/*` - # * Each location has a collection of Redis clusters, named: `/clusters/*` - # * As such, Redis clusters are resources of the form: - # `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` - # - # Note that location_id must be a GCP `region`; for example: - # * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` - # - # @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_cluster version: :v1, transport: :grpc, &block - require "google/cloud/redis/cluster/#{version.to_s.downcase}" - - package_name = Google::Cloud::Redis::Cluster - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Redis::Cluster.const_get(package_name).const_get(:CloudRedisCluster) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CloudRedisCluster service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Redis::Cluster.cloud_redis_cluster}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CloudRedisCluster service, - # or if the versioned client gem needs an update to support the CloudRedisCluster 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_cluster_available? version: :v1, transport: :grpc - require "google/cloud/redis/cluster/#{version.to_s.downcase}" - package_name = Google::Cloud::Redis::Cluster - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Redis::Cluster.const_get package_name - return false unless service_module.const_defined? :CloudRedisCluster - service_module = service_module.const_get :CloudRedisCluster - 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-cluster 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_cluster if block_given? - - ::Google::Cloud.configure.redis_cluster - end - end - end - end -end - -helper_path = ::File.join __dir__, "cluster", "helpers.rb" -require "google/cloud/redis/cluster/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb b/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/version.rb deleted file mode 100644 index 69afe88537e4..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/lib/google/cloud/redis/cluster/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 Cluster - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/client_test.rb deleted file mode 100644 index ebe5ffde87a6..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/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/cluster" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Redis::Cluster::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_cluster_grpc - skip unless Google::Cloud::Redis::Cluster.cloud_redis_cluster_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::Cluster.cloud_redis_cluster transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client, client - end - end - - def test_cloud_redis_cluster_rest - skip unless Google::Cloud::Redis::Cluster.cloud_redis_cluster_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Redis::Cluster.cloud_redis_cluster transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb b/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/version_test.rb deleted file mode 100644 index f4255931d11b..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/test/google/cloud/redis/cluster/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/cluster/version" - -class Google::Cloud::Redis::Cluster::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Redis::Cluster::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-redis-cluster/test/helper.rb b/owl-bot-staging/google-cloud-redis-cluster/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-cluster/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"